-
Notifications
You must be signed in to change notification settings - Fork 11
unable to complete - TypeError: 'NoneType' object is not iterable #15
Comments
ok fixed a variables in hangouts_to_sms.py
now getting the following issue
Any ideas? |
https://github.com/er0sin/hangouts_to_sms |
Thanks @jgroom33 I ran your branch, got the follow issues. Any chance you can help ?
|
Add a print statement on line 26 to see what value is causing the error. |
sorry @jgroom33 im a bit of a novice, can you help correct my syntax? Hangouts_parser.py
|
looks like you have bad json (the code isn't even parsing the file). does it parse properly at jsoneditoronline.org |
maybe try stripping the json file down to just a couple messages. unless you can figure out where character: position 766505 |
great found the offending characters, do you think we can alter the script to strip out any character that cant be decoded and replace them or delete them, im finding 100's of characters that are the offending issues are all emojis |
did a regex in notepad++ to remove all non-ascii characters |
so got the parser complete, now stuck at formatting. Any ideas? thanks again for all the help @jgroom33
Looked at the suggestions in #12 but still get issues below @mrdehate
here is the code snippet |
I'd suggest trying to implement the character replacement using python and add it to this library. |
great suggestion ill try to add in the character replacement in python and add in |
I was able to get this to work by adding an encoding option to the open command on line 25: with open(hangouts_file_name, 'rt', encoding='utf-8') as data_file: The xml format that came out of it also specified a Edit: It worked fine this way! |
Addressing adein#15, changing the open to UTF-8 encoding to allow for basic emoji characters (and other characters). I believe adein#15 only effected Windows users (as the `open` command would default to using `cp1215` encoding instead of `utf-8`), but the addition of the encoding generally makes the code more robust IMO.
update:
Added explicit path for all files in the hangouts_to_sms.py file. still unable to run. Any ideas ? thanks heaps (by the way thanks for pulling this solution together will be great to get this working)
The text was updated successfully, but these errors were encountered: