简体   繁体   中英

GAE SDK 1.9.5 and an InvalidCertificateException

Trying to import testbed from GAE SDK 1.95 with Python2.7.8 on osX Maverics 10.9.5 and I'm getting a InvalidCertificateException error.

    from google.appengine.ext import testbed   
  File "/usr/local/google_appengine/google/appengine/ext/testbed/__init__.py", line 120, in <module>  
    from google.appengine.api import urlfetch_stub   
  File "/usr/local/google_appengine/google/appengine/api/urlfetch_stub.py", line 34, in <module>  
    _fancy_urllib_InvalidCertException = fancy_urllib.InvalidCertificateException  
AttributeError: 'module' object has no attribute 'InvalidCertificateException'   

I looked at the fancy_url module and the InvalidCertificateException class is there, so I don't understand why it's not importing.

Apparently others have had the same error, so I attempt to correct it by deleting: urlfetch_cacerts.txt AND cacerts.txt from:

GoogleAppEngineLauncher/Contents/Resources/GoogleAppEngineDefault.bundle/Content‌​s/Resources/google_appengine/lib/cacerts/

Apparently the GAE installer creates a nested directory, this was fixed by copying the contents in:

cd /usr/local/google_appengine/lib
cp fancy_urllib/fancy_urllib/__init__.py fancy_urllib/__init__.py 

This is how the module is incorrectly structured, it looks like these 2 init .py files are duplicate:

/usr/local/google_appengine/lib/fancy_urllib/__init__.py   # this file is empty
/usr/local/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py # this file contains the functions.

FIXED THE ERROR

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM