弄过GAE的帮帮忙.
import sys, urllib2
headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'}
req = urllib2.Request("http://www.yge.me", headers=headers)
content = urllib2.urlopen(req).read()
type = sys.getfilesystemencoding()
print content.decode("UTF-8").encode(type)
2012-11-04 12:35:51,535 ERROR appcfg.py:2202 An error occurred processing file '': <urlopen error [Errno 10060] >. Aborting.
Traceback (most recent call last):
File "F:\Program Files (x86)\Google\google_appengine\appcfg.py", line 171, in <module>
run_file(__file__, globals())
File "F:\Program Files (x86)\Google\google_appengine\appcfg.py", line 167, in run_file
execfile(script_path, globals_)
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4322, in <module>
main(sys.argv)
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4313, in main
result = AppCfgApp(argv).Run()
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2599, in Run
self.action(self)
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4048, in __call__
return method()
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3065, in Update
self.UpdateVersion(rpcserver, self.basepath, appyaml)
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3047, in UpdateVersion
lambda path: self.opener(os.path.join(basepath, path), 'rb'))
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2172, in DoUpload
self.resource_limits = GetResourceLimits(self.rpcserver, self.config)
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 357, in GetResourceLimits
resource_limits.update(GetRemoteResourceLimits(rpcserver, config))
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 328, in GetRemoteResourceLimits
version=config.version)
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 403, in Send
self._Authenticate()
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 543, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 342, in _Authenticate
self._GetAuthCookie(auth_token)
File "F:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 268, in _GetAuthCookie
response = self.opener.open(req)
File "F:\Python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
File "F:\Python27\lib\urllib2.py", line 418, in _open
'_open', req)
File "F:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "F:\Python27\lib\urllib2.py", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "F:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 383, in do_open
raise url_error
urllib2.URLError: <urlopen error [Errno 10060] >
2012-11-04 12:35:51 (Process exited with code 1)
cron:
- description: test
url: main.py #好像这里是错的
schedule: every 10 minutes #不知道指定时间写法
application: ***** #我的GAE id
version: 1
runtime: python27
api_version: 1
threadsafe: yes