python-attrs / attrs

Python Classes Without Boilerplate
https://www.attrs.org/
MIT License
5.3k stars 374 forks source link

importing ctypes & throwing strange error on GAE (App Engine) Py2.7 #631

Closed dgaedcke closed 4 years ago

dgaedcke commented 4 years ago

This line: site-packages/attr/_compat.py", line 95, in import_ctypes is crashing on devappserver (local GAE dev emulator) because os.uname() is returning empty string.

Full stack trace in this SO post: https://stackoverflow.com/questions/60533259/devappserver-py-for-app-engine-std-on-localhost-is-clearing-os-uname-crashing

Do you have any thoughts or advice for me?

dgaedcke commented 4 years ago

it seems endpoints is specifying the correct version (attrs==17.4.0) of attrs here: https://github.com/cloudendpoints/endpoints-python/blob/master/requirements.txt

dgaedcke commented 4 years ago

I've forked the endpoints library & it turns out that her use of attrs is limited to just 4 classes.

@attr.s(frozen=True, slots=True)
class OAuth2Scope(object):
    scope = attr.ib(validator=attr.validators.instance_of(basestring))
    description = attr.ib(validator=attr.validators.instance_of(basestring))

Issuer = attr.make_class('Issuer', ['issuer', 'jwks_uri'])
# 2 more similar to above

so if I can figure out how to add the boilerplate that you were adding for her, I might be able to work around this problem. Although something tells me I'll it it again from another library??

wsanchez commented 4 years ago

The stack trace in the OS post appears to be crashing in .../ctypes/__init__.py (line 29) during the import of the ctypes module.

That's not indicative of a bug in attrs as far as I can tell, and more likely is an issue with the Python interpreter you are using.

dgaedcke commented 4 years ago

Yes, I get that ... I was just wondering if you have any insight into what could cause this behavior. You pointing at the Py interpreter over the GAE devappserver is interesting because line 1 implies that Python has it right until something else changes the environment. I had assumed that must be GAE but you are far more knowledgable on this stuff than me. Thanks for your response!!

hynek commented 4 years ago

This is unfortunate but nothing we can help you with:

Try to convince the maintainer to lift that pin or at least update to a more up to date version?

Closing because we did everything we can do last year.