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
Small python3 compatibility fixes #21038
Small python3 compatibility fixes #21038
Conversation
Have we been adding these kind of wrapper functions to much code already? I think either this needs some inline documentation or linting as otherwise this will regress again. It also makes this code harder to maintain which isn't great. |
Imo, the right way is to start running some of the tests with py3, not only the lint and unit tests. Would that be ok ? EDIT: my goal is to run those tests with python3, i think its enough for now to detect regressions. |
I had two concerns, regressions and maintainability. It sounds like there's a plan to deal with regressions, but not necessarily maintenance. Would it be a big ask that for the test files we have an explicit |
I could add it here but that would be weird to add it only here and not everywhere it's being used. If you really want comments, I guess I can deal with it ... Imo everything from the six module is for py2/py3 compatibility as it's the sole purpose of this module and it's well known enough that it should not be a surprise. |
I might be an outlier, but the main reason I write Python these days is for these small WPT server scripts. It's certainly new to me. |
Is there a dev documentation where I could add what is six and why it's being used? |
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.
I'm sure this will regress, but I think the ultimate solution will be to run tests with both Python 3 and Python 2 and ensure that we get the expected results in each case. Documentation is good, but in practice most people won't read it.
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.
I would like to see documentation. Again, especially for things that affect writing tests.
Not really sure why documentation is suddenly not considered important. When onboarding people it's super helpful to have good documentation and I personally refer to https://web-platform-tests.org/ quite often for patterns I don't often use.
My point of view is that in the short term we "don't care" about regressions here. Since we don't really have any way to enforce correctness we have to be content to accept that authors can and will land things that don't work with Python 3. Therefore at present we aren't imposing any new requirements on anyone, and there isn't a strong need to add documentation at this stage. Once we decide that enough code works with Python 3 to make it a going concern we'll need an RFC decision to make Py3 an officially supported environment, and that will require documentation and a strategy to keep things working in both environments (e.g. running the tests in both, linting, etc.). So this isn't about "not considering documentation important". It's about not blocking forward progress on changes to make the code work in order to deal with issues that can be safely deferred to the time when they are actual requirements. That said, if there were a docs change PR now I'd accept it as long as it didn't imply that Py3 support was actually required. |
Again, my main concern is not regressions, it's maintenance. |
I will change the document @annevk pointed me to. Just did not had time yet 👍 |
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.
Thank you and no need to apologize.
…handler This is needed so that we can compare it with those extracted by BaseHTTPRequestHandler which will by given to us as a string.
for python3 compatibility
Building the docs:
|
@jgraham i've removed the link in the doc because its not really feasible to include a link that refers to something in |
I found some problems again when trying to run servo wpt tests with Python3 (see servo/servo#25377)
This is step in the right direction but not sure yet if it will suffice.