-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to Python3 #59
Port to Python3 #59
Conversation
@@ -256,9 +266,9 @@ def __reader(self, collector, source): | |||
while True: | |||
data = os.read(source.fileno(), 65536) | |||
self.__lock.acquire() | |||
collector.append(data) | |||
collector.append(data.decode("ascii")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not append the .decode
directly to the os.read
call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're totally right, I've put out of the locked zone, and it would have saved me a bug investigation; because data == ""
could not be True when data was bytes, so the thread never quit and I had 100% usage when stopping the player!
I've fixed that and squashed the commits.
This is great, thanks a lot! Should I merge this now, or would you prefer to test it for a while? |
66be689
to
65c6ce9
Compare
Tested with Python 3.5.0. The port mainly consists in handling correctly byte-string and unicode strings. File buffering is also handled a bit differently, and a race condition on player termination appeared in my PY3 environment but on in PY2.
Result return by subprocess is in bytes in PY3. Works also in PY2.
it seems fine to me, I've tested the CLI functionalities, so "normal" situations are okay. Hopefully there are no abnormal situation*, so you can merge. (* I saw once a |
Thanks a lot for your help :) If you see anything else (or would even like to give the mpd port (#45) a stab 😉), feel free to send a PR! |
Great, thanks :) It's a nice tool you've developed, with good service provider behind, so I think I'll use it a lot, and I'll report/fix problems on the way! I'll give a try to the MPD port as well. |
Danilo, you added me as author and close the PR ... but didn't merge it ... is it on purpose ... ? |
😳 sorry, that was a mistake! |
Now! :) Thanks! |
Hello,
I've ported orochi code to Python3. It passes the testsuite (after a minor fix on the testsuite itself).
I'm now using it at home, I'll report and fix the bugs I may encounter with this new version.
Regards,
Kevin
Tested with Python 3.5.0.
The port mainly consists in handling correctly byte-string and
unicode strings. File buffering is also handled a bit differently,
and a race condition on player termination appeared in my PY3
environment but on in PY2.