Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Unable to sync to Dropbox : Error:'ascii' codec #31

Closed
ghost opened this issue Aug 19, 2017 · 10 comments
Closed

Unable to sync to Dropbox : Error:'ascii' codec #31

ghost opened this issue Aug 19, 2017 · 10 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Aug 19, 2017

When I get to sync to Dropbox for the first time I have this error after I enter the API authorization keys:

Error:'ascii' codec can't encode character u'\xe9'
in position 15: ordinal not in range(128)
Please try again.

@giowck giowck added the support label Sep 26, 2017
@giowck
Copy link
Owner

giowck commented Sep 26, 2017

Can't reproduce this, never seen that error.

Which version and operating system are you using?

@joshirio
Copy link
Collaborator

joshirio commented Nov 6, 2017

No feedback, no way to reproduce, closing this.

If the original reporter or anyone else experience this, please feel free to comment to investigate this further.

@joshirio joshirio closed this as completed Nov 6, 2017
@jlehtoma
Copy link

I'm getting the the same error message while trying to sync to Dropbox.

Error:'ascii' codec can't encode character u'\xe4' in position 18: ordinal not in range(128) 
Please try again.

I'm on openSUSE Tumbleweed 64-bit running Symphytum 2.2 from AppImage. The only thing I can think of is a non-ASCII characters in the data entered, but I don't know how Symphytum deals with Unicode encoding.

@joshirio joshirio reopened this Feb 1, 2018
@joshirio joshirio added the bug label Feb 1, 2018
@joshirio
Copy link
Collaborator

joshirio commented Feb 1, 2018

Thanks for the feedback.

Does this happen consistently each time the auth key is entered or just randomly?
Does this happen only on openSUSE or also on Windows/other Linux distros?
Does your dropbox username contain non ascii characters, such as ö, ß, µ, etc...?

I'm trying to figure out if this is a dropbox API call issue on their SDK or some other distribution (dependency) issues because the AppImage doesn't ship python but uses the one provided by the system on linux.

EDIT: just tested on openSUSE TW, had no issues, so looks like it it not due to a distribution/dependecy problem.

@jlehtoma
Copy link

jlehtoma commented Feb 1, 2018

Does this happen consistently each time the auth key is entered or just randomly?

Consistently.

Does this happen only on openSUSE or also on Windows/other Linux distros?

So far I've been only able to test it on openSUSE.

Does your dropbox username contain non ascii characters, such as ö, ß, µ, etc...?

My Dropbox username (a gmail address) does not contain non-ASCII characters. However, my surname does ('ä'). Not sure what exactly what gets passed around through the API.

I'm trying to figure out if this is a dropbox API call issue on their SDK or some other distribution (dependency) issues because the AppImage doesn't ship python but uses the one provided by the system on linux.

EDIT: just tested on openSUSE TW, had no issues, so looks like it it not due to a distribution/dependecy problem.

I'll dust my Windows VirtualBox image and see what happens there.

@jlehtoma
Copy link

jlehtoma commented Feb 1, 2018

I was able to reproduce the same issue on Windows (7, 64-bit) using Symphytum 2.2 (build 7).

@joshirio
Copy link
Collaborator

joshirio commented Feb 1, 2018

Thanks, I think it has to be the non-ascii characters in the name because once the login is successful, Symphytum checks and displays the user name as confirmation: 'Logged in as $USER'.

OK, I have run some tests, really weird. First, it is really caused by the user name (name and/or surname) of the dropbox account containing non-ascii characters. But it gets weird because the same works on my current OS (Arch Linux) but fails on openSUSE TW with AppImage.

suse
arch_system_pypkg

Then I tried the AppImage on working systems and that fails too.
This means the issue is not the dropbox SDK, nor Symphytum, it is caused by a python dependency which was shipped in a buggy version because native packages that use the system's python libraries used by the dropbox SDK work just fine while the AppImage, shipping all python deps, fails.

The solution would be to update the bundled python packages.

Thanks, your feedback was really helpful.

@joshirio joshirio self-assigned this Feb 1, 2018
@joshirio joshirio added this to the 2.3 milestone Feb 1, 2018
@joshirio
Copy link
Collaborator

joshirio commented Feb 1, 2018

After investigating a bit further, turns out this is not caused only by python deps but it is also related to python version 2.7. The AppImage, macOS and Windows dist use python 2.7 while the working installs are using python 3. Python 3 changed the default encoding format from ASCII to UTF-8.

Solution: configure pyinstaller on Windows, macOS and AppImage to use python3 instead of v2.7 or drop the user name API request entirely and use another call to check for success.

EDIT: trivial fix by using python's encode('utf-8') function on user name...

@ghost
Copy link
Author

ghost commented Feb 15, 2018

Thank you jlehtoma and joshirio for this solution. I replaced my dropbox_client.py file in the Symphytum application folder with version 869b517 and the synchronization worked fine. I also confirm that if I removing any accent (eg.: é for e) on my first name and last name on my Dropbox account, that's also worked on another computer without replacing the file.

@joshirio
Copy link
Collaborator

Symphytum v2.3 with this fix, will be out soon (1 or 2 weeks). Thanks for confirming.

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

No branches or pull requests

3 participants