-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
setuptools.depends.get_module_constant doesn't work in Python 3.6? #866
Comments
I've confirmed this is indeed the case, and there's no test case in setuptools to even capture this usage. Would you be willing to look into the underlying cause and recommend a fix? |
Just having a little debug, and it seems that the byte format may have changed. For example, currently python-memcached is broken due to the use of The line in question is (https://github.com/pypa/setuptools/blob/master/setuptools/depends.py#L99) In python3.6 the line returns In python3.5 the line returns Not sure where the underlying issue really lies, but it seems that the arg value is 8-bit in this particular use case in 3.6 and 16-bit in 3.5 |
…de` instead of the internal `_iter_code`. The `dis` module was already used in `_iter_code` so I figured it was safe to use `Bytecode` from it. Not sure how this assumption holds up across all supported Python releases. I can only assume `Bytecode` wasn't there before when `_iter_code` was originally written? Note that `_iter_code` doesn't appear to be called anywhere in light of this change so I removed it. I should also note that `get_module_constant` has never worked with `setuptools.__version__` (returns -1) because it's not a string literal; it gets that attribute from another module. But this change does work in cases where a string literal is requested. pypa#866
I can't really speak to how the bytecode arrangement may have changed, that's a bit above my pay grade. I did notice that I should point out that in the original case I posted:
Cases like Overall I'm not 100% sure why packages like python-memcached are using this compiler/AST based function |
Thanks to both of you for this analysis. I have some tests that should prove @Preston-Landers fix. |
…pectation in the byte-code processing that's now failing on Python 3.6.
I've pushed the commits up in the [issue-866 branch](/pypa/setuptools/tree/issue-866], but unfortunately, the new test added in 6a960cb is failing on pypy (only after the use of dis.Bytecode). Aha. Looking at the docs for dis, Bytecode was added in Python 3.4. That also explains the other failures in that build. |
Fix rolling out as v32.3.1. |
- remove Python 3.6 for now as setuptools is broken there, see pypa/setuptools#866 - add Django 1.11 pre release, this will fail at least until fix for python-social-auth/social-app-django#24 is released Signed-off-by: Michal Čihař <michal@cihar.com>
I get a similar crash under setuptools v36.0.1, python v3.6.2rc1, pip 9.0.1:
|
upgrading setuptools from v36.0.1 to v36.2.7 fixed it |
I ask because I'm trying to use
python-memcached
which uses thisget_module_constant
and fails like that. Thanks.The text was updated successfully, but these errors were encountered: