jtpio / trello-full-backup

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

using python 2.7.13 I got an error, encoding='utf-8' is not a paramter of open. #12

Closed eorojas closed 7 years ago

eorojas commented 7 years ago

I fixed this by importing "codec" and calling codec.open instead. When I did this I also got an error at line 43 in function get_name when reading an utf-8 string. Fixed by change name to name.encode('utf-8')

skrajewski commented 7 years ago

I got the same error, full traceback:

Traceback (most recent call last):
  File "/usr/local/bin/trello-full-backup", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/trello_full_backup/__init__.py", line 5, in main
    cli()
  File "/usr/local/lib/python2.7/site-packages/trello_full_backup/backup.py", line 302, in cli
    backup_board(board, args)
  File "/usr/local/lib/python2.7/site-packages/trello_full_backup/backup.py", line 158, in backup_board
    write_file(file_name, board_details)
  File "/usr/local/lib/python2.7/site-packages/trello_full_backup/backup.py", line 51, in write_file
    with open(file_name, 'w', encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
jtpio commented 7 years ago

This is specific to Python 2. Only Python 3.4+ is supported for this script. Try to upgrade your version of Python if possible, or use the Docker image.