-
Notifications
You must be signed in to change notification settings - Fork 320
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
workaround for pathlib on py 3.7 #584
Conversation
fixes eventlet#534 pathlib._NormalAccessor wraps `open` in `staticmethod` for py < 3.7 but not 3.7. That means we `Path.open` calls `green.os.open` with `file` being a pathlib._NormalAccessor object, and the other arguments shifted. Fortunately pathlib doesn't use the `dir_fd` argument, so we have space in the parameter list. We use some heuristics to detect this and adjust the parameters (without importing pathlib)
124c7eb
to
67ebfdd
Compare
Codecov Report
@@ Coverage Diff @@
## master #584 +/- ##
=====================================
- Coverage 46% 46% -1%
=====================================
Files 81 81
Lines 7976 7978 +2
Branches 1365 1366 +1
=====================================
- Hits 3728 3701 -27
- Misses 3995 4019 +24
- Partials 253 258 +5
Continue to review full report at Codecov.
|
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.
LGTM
Thank you for your work! Smart solution. |
Thanks @jstasiak . Any chance of a point version release with this fix to unblock kombu? Anything I can do to help with that? |
If you could prepare something like #572 for version 0.25.1 I can merge and release this within an hour. |
sure, raised #585 |
Done, just released now. |
Thanks! |
* remove automatic monkey-patching (resolves #703) * warns users if the monkeypatch is not applied * suggests using pytest-eventlet as an alternative * static * add nameko test command + update warning + move nameko run patch into cli so it is earlier and more explicit * add __main__ entrypoint so CI can run nameko test * always continue on error for debug * 0.25.1 is oldest supported eventlet on py37+ we need eventlet/eventlet#584 * Revert "always continue on error for debug" This reverts commit e6fc162. * don't need pytest-eventlet plugin anymore
* remove automatic monkey-patching (resolves #703) * warns users if the monkeypatch is not applied * suggests using pytest-eventlet as an alternative # Conflicts: # nameko/testing/pytest.py * static * add nameko test command + update warning + move nameko run patch into cli so it is earlier and more explicit * add __main__ entrypoint so CI can run nameko test * 0.25.1 is oldest supported eventlet on py37+ we need eventlet/eventlet#584 * don't need pytest-eventlet plugin anymore
pathlib._NormalAccessor wraps
open
instaticmethod
for py < 3.7 butnot 3.7. That means we
Path.open
callsgreen.os.open
withfile
being a pathlib._NormalAccessor object, and the other arguments shifted.
Fortunately pathlib doesn't use the
dir_fd
argument, so we have spacein the parameter list. We use some heuristics to detect this and adjust
the parameters (without importing pathlib)
fixes #534