本文介绍了GAE SDK 1.9.5和InvalidCertificateException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在osX Maverics 10.9.5上使用Python2.7.8从GAE SDK 1.95导入测试平台并且我收到一个InvalidCertificateException错误.

Trying to import testbed from GAE SDK 1.95 with Python2.7.8 on osX Maverics 10.9.5and 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'   

我看了看fancy_url模块,那里有InvalidCertificateException类,所以我不明白为什么它不导入.

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

显然其他人也有相同的错误,因此我尝试通过以下方式删除此错误: urlfetch_cacerts.txt cacerts.txt :

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/

推荐答案

显然,GAE安装程序创建了一个嵌套目录,该目录通过复制以下内容来解决:

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 

这是错误地构造模块的方式,看起来这两个 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.

修复了错误

这篇关于GAE SDK 1.9.5和InvalidCertificateException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 23:34