Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding only work for root directory on copy_remote_file #284

Closed
scheraud opened this issue Mar 2, 2021 · 2 comments
Closed

Encoding only work for root directory on copy_remote_file #284

scheraud opened this issue Mar 2, 2021 · 2 comments
Labels

Comments

@scheraud
Copy link

scheraud commented Mar 2, 2021

For general questions please use the mail group.

Describe the bug
When copy_remote_file is used with recurse=True and a specific encoding. The encoding don't seem to work.

To Reproduce
The problem occur when files or folders contain non ascii character. Something like "Suivi activité" in my case.

Steps to reproduce the behavior:
client.copy_remote_file("/", "/some/folder/", recurse=True, encoding="cp1252")

Expected behavior
The encoding should work on files and subfolders

Actual behaviour
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 32: invalid continuation byte

Additional information
I think the root cause is that _copy_remote_dir in base/single.py don't pass the encoding parameter.

@pkittenis pkittenis added the bug label Mar 2, 2021
@pkittenis
Copy link
Member

pkittenis commented Mar 2, 2021

Hi there,

Thanks for the interest and report. Yes, this looks like a bug with copy_remote_file - encoding is not passed on when recursion is enabled. Worth checking the same is not true for copy_file as well.

PR welcome if anyone wants to make one.

@pkittenis
Copy link
Member

Resolved by #313

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants