ilanschnell / bsdiff4

binary diff and patch using the BSDIFF4-format
Other
118 stars 26 forks source link

Using 1.1.2 on Windows environment fails to import unix only os.path module samefile #2

Closed tyroneabdy closed 11 years ago

tyroneabdy commented 11 years ago

Hi

We recently ran into an issue with trying to update from 1.1.1 to 1.1.2.

We received the following exception when running. It appears like the usage of samefile has been included which is noted in os.path as a unix only module.

Traceback (most recent call last): File "C:\Python27\lib\site-packages\mock.py", line 1607, in _inner return f(_args, *_kw) File "C:\Program Files\Jenkins\jobs\payroll (GERRIT)\workspace\src\wwlib\model\test_updater.py", line 413, in test_apply_patch os.path.join(updater.frozen_updates_dir, 'TestProgram-2012.0.1.linux.from-2012.0.0.patch')) File "C:\Program Files\Jenkins\jobs\payroll (GERRIT)\workspace\src\wwlib\model\updater.py", line 472, in apply_patch bsdiff4.file_patch(source_filename, temporary_filename, patch_filename) File "C:\Python27\lib\site-packages\bsdiff4\format.py", line 120, in file_patch from os.path import isfile, samefile ImportError: cannot import name samefile

ilanschnell commented 11 years ago

I just pushed a fix which removes the use of os.path.samefile. Instead, the absolute paths are compared, which also works on Windows.

ilanschnell commented 11 years ago

Just made a 1.1.3 release which includes the fix.