jtpio / trello-full-backup

Python script to backup everything from Trello: boards, lists, cards and attachments
MIT License
123 stars 36 forks source link

Encoding Error in Win10 Debian subsystem #22

Open demokrit2017 opened 5 years ago

demokrit2017 commented 5 years ago

I try to get the script running under a Debian subsystem running below Win10. I sadly get this error and have no idea what to do about.

Backing up to: /mnt/c/temp/trello_bkup/test/ Incremental: False Tokenize: False Backup my boards: True Backup organization boards: False Backup closed board: False Backup archived lists: False Backup archived cards: False Attachment size limit (bytes): 100000000

Saving full json for board Essensplan with id *** to Essensplan_full.json Traceback (most recent call last): File "/usr/local/bin/trello-full-backup", line 11, in sys.exit(main()) File "/usr/local/lib/python3.5/dist-packages/trello_full_backup/init.py", line 5, in main cli() File "/usr/local/lib/python3.5/dist-packages/trello_full_backup/backup.py", line 318, in cli backup_board(board, args) File "/usr/local/lib/python3.5/dist-packages/trello_full_backup/backup.py", line 175, in backup_board backup_card(id_card, c, args.attachment_size, tokenize) File "/usr/local/lib/python3.5/dist-packages/trello_full_backup/backup.py", line 111, in backup_card mkdir(card_name) File "/usr/local/lib/python3.5/dist-packages/trello_full_backup/backup.py", line 27, in mkdir if not os.access(name, os.R_OK): UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 5: ordinal not in range(128)

jtpio commented 5 years ago

Thanks for the report.

It looks like an encoding issue. Would it be possible to try on Win10 directly (outside of the Debian subsystem)?

demokrit2017 commented 5 years ago

Easy said... Is there any native way to run under Windows 10? Trying to install Docker directly on Win10 required Hyper-V, screwing up the Juniper VPN Setup... Also a CR regarding the Local Firewalls is required on IT supplier site^^ - If there is no native way, I would sadly say it is not possible to test :(

demokrit2017 commented 5 years ago

OK, finally done. With PIP for Win10 I've managed to get it running. Some characters like " are still causing problems when used in Trello Headlines while not being escaped, but the Option -t solves this.

Apart from this: A really great tool! Thanks, man. I just need to test to restore some stuff now ;)

eyaler commented 4 years ago

i am getting encoding error in windows 10

Traceback (most recent call last): File "c:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\anaconda3\scripts\trello-full-backup.exe\__main__.py", line 7, in <module> File "c:\anaconda3\lib\site-packages\trello_full_backup\__init__.py", line 5, in main cli() File "c:\anaconda3\lib\site-packages\trello_full_backup\backup.py", line 318, in cli backup_board(board, args) File "c:\anaconda3\lib\site-packages\trello_full_backup\backup.py", line 175, in backup_board backup_card(id_card, c, args.attachment_size, tokenize) File "c:\anaconda3\lib\site-packages\trello_full_backup\backup.py", line 119, in backup_card print('Saving', card_name) File "c:\anaconda3\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 2-4: character maps to <undefined>

eyaler commented 4 years ago

the above is from bash. from cmd i am seeing:

Traceback (most recent call last): File "c:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "c:\anaconda3\scripts\trello-full-backup.exe\__main__.py", line 7, in <module> File "c:\anaconda3\lib\site-packages\trello_full_backup\__init__.py", line 5, in main cli() File "c:\anaconda3\lib\site-packages\trello_full_backup\backup.py", line 302, in cli org_boards_data['me'] = requests.get(my_boards_url).json() File "c:\anaconda3\lib\site-packages\requests\models.py", line 898, in json return complexjson.loads(self.text, **kwargs) File "c:\anaconda3\lib\json\__init__.py", line 354, in loads return _default_decoder.decode(s) File "c:\anaconda3\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "c:\anaconda3\lib\json\decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)