Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Upgrade to python 3.6 #50

Open
GerbenJdeBoer opened this issue Jun 6, 2018 · 0 comments
Open

Upgrade to python 3.6 #50

GerbenJdeBoer opened this issue Jun 6, 2018 · 0 comments

Comments

@GerbenJdeBoer
Copy link

GerbenJdeBoer commented Jun 6, 2018

  1. Remove the 2 lines as explained in
    https://stackoverflow.com/questions/3828723/why-should-we-not-use-sys-setdefaultencodingutf-8-in-a-py-script
#DEL# reload(sys)
#DEL# sys.setdefaultencoding('utf-8')
  1. Catch the error TypeError: a bytes-like object is required, not 'str' by opening as 'w' instead of 'wb'and by specifying the lineterminator explicitly to remove white lines.
#DEL#with open(full_output_path, 'wb') as f:
#DEL#    w = csv.DictWriter(f, fields)
with open(full_output_path, 'w') as f:
    w = csv.DictWriter(f, fields, lineterminator='\n')
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant