-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fixes #4949 UnicodeEncodeError in upload.models.update_from_session #4950
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4950 +/- ##
=======================================
Coverage 59.87% 59.87%
=======================================
Files 231 231
Lines 12431 12431
Branches 1799 1799
=======================================
Hits 7443 7443
Misses 4374 4374
Partials 614 614 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, I'd prefer to ignore unreadable characters instead of getting rid completely of user infos.
Moreover, it is useful to add tests for such cases. We don't have much regarding encoding.
Give me some time to update a bit this PR and maybe, with the occasion, trying to understand if there are other points of failure due to special characters present on user name. This is not the first time we face a similar issue.
@afabiani the error is caused by the check being done. Removing that two lines won't remove the information from the upload_session and Python handles it without problems even with not ascii characters in my test. |
... or in case it is good for a thing we currently do not see how about keep it but fail silently?
|
Well, interpreting the code it seems that the original intention was to pickle the user info into the database. The existing check, tries to remove "unpickable" utf-8 characters. Removing them or doing a silent check, means avoid saving completely that info into the DB. Now, it is possible that it is not used anywhere else later on, but it is worth to double check IMHO. |
thanks @afabiani I just merged it |
Ref: #4935 |
Fixes #4949
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.