Closed BarbaraDi closed 1 year ago
Might be a Python 3 vs 2 issue.
Can you provide the full traceback?
The same here:
Traceback (most recent call last):
File "/home/user/polar-flow-export/polar-export.py", line 67, in <module>
run(driver, username, password, month, year, output_dir)
File "/home/user/polar-flow-export/polar-export.py", line 56, in run
export_exercise(driver, ex_id, output_dir)
File "/home/user/polar-flow-export/polar-export.py", line 47, in export_exercise
outfile.write(tcx_data)
TypeError: a bytes-like object is required, not 'str'
Python 3.11.3
And the solution is to change:
outfile = open(os.path.join(output_dir, filename), 'wb')
to
outfile = open(os.path.join(output_dir, filename), 'w')
Fixed in #2.
Hello, Thank you for your script. When trying to execute, I get an error on the writing part:
TypeError: a bytes-like object is required, not 'str'
What did I do wrong? :-)