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

Error encoding mail #7

Closed
SettlerSW opened this issue Mar 10, 2016 · 13 comments
Closed

Error encoding mail #7

SettlerSW opened this issue Mar 10, 2016 · 13 comments
Assignees

Comments

@SettlerSW
Copy link

Hello,

(Sorry for my bad english)
For some e-mail, i've an UnicodeDecodeError, it seems the e-mail is already in UTF-8.

13:07:01 INFO [email protected] Processing message 17 in label 'dlabbe-import'
13:07:01 ERROR [email protected] Failed to import mbox message
Traceback (most recent call last):
  File "import-mailbox-to-gmail.py", line 213, in process_mbox_files
    message_data = io.BytesIO(message.as_string().encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2147: ordinal not in range(128)
@PMox
Copy link
Contributor

PMox commented Mar 11, 2016

Which Python versione are you using?

@SettlerSW
Copy link
Author

Python 2.7.11

Oh and i missed to tell you (but I think it's not the same problem), at the first launch i've had this error :
ImportError: cannot import name SignedJwtAssertionCredentials

So, i've installed oauth2client package (pip install...), but the last version of this package (2.0) don't fix, so i've installed the old 1.5.2 :
pip install oauth2client==1.5.2

@shirkethic
Copy link

Hi Settler, did installing the older version of oauth2client fix that ImportError for you? I'm having the same problem but struggling to overwrite the newer oauth with the older one..

Thanks

@SettlerSW
Copy link
Author

Hi shirkethic,

No, i've write a poor hot fix with my poor knowledge in python to import these type of mail (<5% of all mail) with a bad encoding.

@eesheesh eesheesh self-assigned this Mar 11, 2016
@eesheesh
Copy link
Collaborator

With regards to the encoding issue: I think I managed to fix it, I'll upload a new release shortly.

With regards to the cannot import name SignedJwtAssertionCredentials error - the new release will fix it.

Thanks for reporting!

@eesheesh
Copy link
Collaborator

Fixed in commit f049fa4.

@eesheesh
Copy link
Collaborator

@Settler6079SW and @shirkethic, can you try the new version? Please let me know whether it works now.

Thanks!

@shirkethic
Copy link

Hi Liron,

Should we upgrade again back to the latest v of

pip install oauth2client

which version is correct for this build?

Many thanks!

Paul

On 11 Mar 2016, at 21:17, Liron Newman [email protected] wrote:

@Settler6079SW https://github.com/Settler6079SW, can you try the new version https://github.com/google/import-mailbox-to-gmail/releases/tag/v1.2? Please let me know whether it works now.

Thanks!


Reply to this email directly or view it on GitHub #7 (comment).

@eesheesh
Copy link
Collaborator

@shirkethic the correct version is the latest version of oauth2client.

You'd need to use pip install -U oauth2client to upgrade it to the latest version.

@SettlerSW
Copy link
Author

Hello @eesheesh

Here is the message :

13:01:27 ERROR [email protected] Failed to import mbox message Traceback (most recent call last): File "import-mailbox-to-gmail.py", line 214, in process_mbox_files message_data = io.BytesIO(message.as_string().encode('ascii')) UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 1920: ordinal not in range(128)

If you want, i have exported the 'message' object with pickle library.

@eesheesh
Copy link
Collaborator

Ok, I think I have it fixed now: https://github.com/google/import-mailbox-to-gmail/releases/tag/v1.3

If it still fails, would it be possible for you to send me the message object, if it doesn't contain any private information?

@SettlerSW
Copy link
Author

Hello @eesheesh

I think it's ok, thanks for your support.

@eesheesh
Copy link
Collaborator

Thanks for confirming!

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

4 participants