-
Notifications
You must be signed in to change notification settings - Fork 138
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
Replacing deprecated alias tostring with tobytes #43
base: master
Are you sure you want to change the base?
Conversation
Tostring is now (python 3.9) a deprecated alias for tobytes. Since peframe requires python 3.6 and tobytes being introduced in python 3.2, there is no loss from removing the use of the alias.
I had the same issue and was about to issue a pull request. It might be good to make it more universal by first checking if you have the
|
thanks @gleeda I'll look better |
Just tested it as well and it works perfectly with python3.9, thanks for the fix! :) |
Checking for tostring, as @gleeda suggested (no offense, nice suggestion imo), would be worth it if it was expected to be able to run for python version below 3.2. I'm not sure there wouldn't be any other compatibility issue, but that would help to avoid breaking some monkey patching in other projects or whatnot. Do you want the PR to be edited with that on my side @guelfoweb ? |
Confirmed that it fixes |
I can confirm this fixes the AttributeError for Python 3.11.3. |
Tostring is now (python 3.9) a deprecated alias for tobytes. Since peframe requires python 3.6 (according to README) and tobytes has been introduced in python 3.2, there is no loss from removing the use of the alias in this project while upgrading python compatibility to 3.9 eventually.
Disclosure: I haven't fully tested it, you may want to build and run in a python 3.9 docker before merging, or set-up some automated tests using github actions. Can help on that if you want.