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

_post function mangles Unicode filenames #10

Closed
geoffblack opened this issue Apr 3, 2019 · 3 comments
Closed

_post function mangles Unicode filenames #10

geoffblack opened this issue Apr 3, 2019 · 3 comments

Comments

@geoffblack
Copy link

In the _post function, your comment says "Remove non-ASCII characters from filenames due to a limitation of the combination of urllib3 (via python-requests) and our server." Instead of dropping all non-ASCII characters to work around web server header encoding support, you should encode the filename using urllib.parse.quote and then decode the filename on the server-side if necessary.

@joesecurity
Copy link
Collaborator

Hi geoffblack,

Thanks for the suggestion. This change would not be compatible with other users of our API.

Furtunately, a fix was just merged in urllib3/urllib3#1492. We will revisit this once the change has been released.

@geoffblack
Copy link
Author

I don't think it would be incompatible - you're not forced to encode if your filename is already in ASCII, though it would require a change on the server side code to support decoding the output. But it's great that urllib merged that change. Let's see how long it takes to make it to mainstream Python.

@joesecurity
Copy link
Collaborator

We just release jbxapi 3.1.1 which includes the updated version of urllib3. You should now be able to upload non-ascii filenames.

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

No branches or pull requests

1 participant