The put() method in fabric honors lcd context, but file_upload() does not. This makes file_upload() fail whenever an lcd context is in place because the either file_upload() code or put() will use the wrong path.
To reproduce this bug just do
cd 'different_local_directory'
with lcd('local_directory'):
file_upload(target_path, 'some_file_in_local_directory')
The relevant code from put is at fabric/operations.py:364
I'd have written a patch, but the behavior of put() wrt paths is complex enough that it seems wrong to duplicate it in file_upload() w/o refactoring fabric to expose it all for reuse.
The put() method in fabric honors lcd context, but file_upload() does not. This makes file_upload() fail whenever an lcd context is in place because the either file_upload() code or put() will use the wrong path.
To reproduce this bug just do
cd 'different_local_directory'
with lcd('local_directory'):
file_upload(target_path, 'some_file_in_local_directory')
The relevant code from put is at fabric/operations.py:364
I'd have written a patch, but the behavior of put() wrt paths is complex enough that it seems wrong to duplicate it in file_upload() w/o refactoring fabric to expose it all for reuse.