devappserver.py for app engine std on localhost is clearing os.uname & crashing in ctypes

流过昼夜 提交于 2020-03-23 12:01:13

问题


I have foolishly reinstalled all my Python 2.7 dependencies and it's broken something. If you notice on line 1, os.uname() has a valid value, but by the time GAE calls ctypes module (line 3), it has been emptied and my local server won't respond to the client.

This feels a bit over my head & I'd appreciate any guidance.

os.uname() is: 19.3.0
INFO     2020-03-04 19:11:42,584 instance.py:294] Instance PID: 8624
os.uname() is: 
ERROR    2020-03-04 19:11:43,311 wsgi.py:269] 
Traceback (most recent call last):
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 311, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject
    __import__(cumulative_path)
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/service_backend/main.py", line 7, in <module>
    import endpoints as google_cloud_endpoints
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/site-packages/endpoints/__init__.py", line 29, in <module>
    from .api_config import api, method
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/site-packages/endpoints/api_config.py", line 44, in <module>
    import attr
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/site-packages/attr/__init__.py", line 5, in <module>
    from . import converters, exceptions, filters, validators
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/site-packages/attr/filters.py", line 7, in <module>
    from ._compat import isclass
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/site-packages/attr/_compat.py", line 139, in <module>
    set_closure_cell = make_set_closure_cell()
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/site-packages/attr/_compat.py", line 129, in make_set_closure_cell
    ctypes = import_ctypes()
  File "/Users/dgaedcke/dev/TouchstoneMicroservices/lib/site-packages/attr/_compat.py", line 95, in import_ctypes
    import ctypes
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 29, in <module>
    if int(_os.uname()[2].split('.')[0]) < 8:
ValueError: invalid literal for int() with base 10: ''

回答1:


attrs hasn't been using ctypes since 19.2.0, so the solution is to get your dependencies somehow updated.



来源:https://stackoverflow.com/questions/60533259/devappserver-py-for-app-engine-std-on-localhost-is-clearing-os-uname-crashing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!