ligerbots / dslogparser

Parse FIRST FRC driver station log files
MIT License
16 stars 10 forks source link

remove 'b' parameter in creation of outstrm with output file #1

Closed railroad890 closed 5 years ago

railroad890 commented 5 years ago

When using this, I found that I would get an error stating a bytes-like object is required, not 'str'. When I removed the 'b' parameter on line 182, I no longer received this error. I was getting the error on both Linux and Windows, and changing this parameter has removed the error on both platforms.

prensing commented 5 years ago

Hmm. What version of Python are you using? Looking at the docs, it looks like they have changed the specs between 2.7 and 3.x; 2.7 wants binary while 3 does not.

railroad890 commented 5 years ago

I am running 3.7. I do remember seeing something when I was researching the error that it was different between 2 and 3.

prensing commented 5 years ago

I did test with both Py2 and 3, but I realize I only did so on Linux, and may not have tested using the "-o" option.

prensing commented 5 years ago

Might want to flag whether binary is needed and branch. I see I put in my (old) standard code for Windows to deal with sys.stdout, but that should change too, I guess.

prensing commented 5 years ago

I updated the script to detect Py2 vs Py3 and then use binary or not.

prensing commented 5 years ago

@railroad890 Thanks for your feedback and hope my script is useful.

BTW, I know know one of the X-Cats really early mentors.