Skip to content

file_upload() behavior for lcd context incompatible with fabric put() #198

Description

@elgow

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions