install_unpacked_wheel creates files such as INSTALLER or RECORD with a .pip extension then renames them to the intended file in order to have an atomic file creation.
Example:
|
# Record details of all files installed |
|
record = os.path.join(dest_info_dir, 'RECORD') |
|
temp_record = os.path.join(dest_info_dir, 'RECORD.pip') |
|
with open_for_csv(record, 'r') as record_in: |
|
with open_for_csv(temp_record, 'w+') as record_out: |
|
reader = csv.reader(record_in) |
|
outrows = get_csv_rows_for_installed( |
|
reader, installed=installed, changed=changed, |
|
generated=generated, lib_dir=lib_dir, |
|
) |
|
writer = csv.writer(record_out) |
|
# Sort to simplify testing. |
|
for row in sorted_outrows(outrows): |
|
writer.writerow(row) |
|
shutil.move(temp_record, record) |
The goal of this issue is to use a better and safer approach.
install_unpacked_wheelcreates files such as INSTALLER or RECORD with a.pipextension then renames them to the intended file in order to have an atomic file creation.Example:
pip/src/pip/_internal/operations/install/wheel.py
Lines 589 to 603 in 9e24b58
The goal of this issue is to use a better and safer approach.