workaround for pathlib on py 3.7#584
Merged
jstasiak merged 1 commit intoeventlet:masterfrom Aug 20, 2019
Merged
Conversation
auvipy
approved these changes
Aug 19, 2019
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.
|
|
Thank you for your work! Smart solution. |
Contributor
Author
|
Thanks @jstasiak . Any chance of a point version release with this fix to unblock kombu? Anything I can do to help with that? |
Contributor
|
If you could prepare something like #572 for version 0.25.1 I can merge and release this within an hour. |
Contributor
Author
|
sure, raised #585 |
Contributor
|
Done, just released now. |
Contributor
Author
|
Thanks! |
mattbennett
added a commit
to mattbennett/nameko
that referenced
this pull request
Oct 11, 2021
mattbennett
added a commit
to mattbennett/nameko
that referenced
this pull request
Oct 11, 2021
mattbennett
added a commit
to nameko/nameko
that referenced
this pull request
Oct 13, 2021
* 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
mattbennett
added a commit
to nameko/nameko
that referenced
this pull request
Oct 13, 2021
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pathlib._NormalAccessor wraps
openinstaticmethodfor py < 3.7 butnot 3.7. That means we
Path.opencallsgreen.os.openwithfilebeing a pathlib._NormalAccessor object, and the other arguments shifted.
Fortunately pathlib doesn't use the
dir_fdargument, so we have spacein the parameter list. We use some heuristics to detect this and adjust
the parameters (without importing pathlib)
fixes #534