ucfopen / VAST

VAST is a Python script that searches an Instructure Canvas course for media and returns results in a CSV file.
GNU General Public License v3.0
12 stars 5 forks source link

Python3: TypeError: a bytes-like object is required, not 'str' #3

Closed bagofarms closed 6 years ago

bagofarms commented 6 years ago

The traceback points to vast.py line 405. It looks like this is because the file is being opened in binary mode, and Python3 is strict about using binary data for files that are opened as binary.

Thetwam commented 6 years ago

The README lists this project as only using Python 2.7.

Updating to 3 is definitely something we should do, but at the moment there is no official support for 3.

bagofarms commented 6 years ago

The "fix" would be removing the b flag from the file open operation, but as you mentioned in-person, that would probably break on any unicode content that would need to be written to the file. I'm closing this issue since a migration to Python3 would be a larger undertaking than this one issue.