我尝试部署时,Google App Engine会抛出此InvalidURL("非数字端口:'%s'"%host [i + 1:])异常。我如何解决它?

时间:2012-10-23 00:08:03

标签: python google-app-engine invalid-url

当我单击项目的Deploy按钮时,它给出了以下错误:文件“C:\ Python27 \ lib \ httplib.py”,第721行,在_set_hostport中 提升InvalidURL(“非数字端口:'%s'”%host [i + 1:]) httplib.InvalidURL:非数字端口:'port'。

之前我已经成功部署了这个项目,所以我尝试恢复文件,以便在正常工作时我会拥有相同的文件。似乎没有骰子。然而,这只是一个黑暗中的刺戳 - 完整的跟踪显示了这一点从Google App Engine的文件开始,而不是我的文件。

任何人都知道如何部署我的项目?

Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 171, in <module>
run_file(__file__, globals())
  File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 167, in run_file
execfile(script_path, globals_)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4191, in <module>
main(sys.argv)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4182, in main
result = AppCfgApp(argv).Run()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2579, in Run
self.action(self)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3927, in __call__
return method()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3040, in Update
updatecheck.CheckForUpdates()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 596, in CheckForUpdates
runtime=self.config.runtime)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 383, in Send
f = self.opener.open(req)
  File "C:\Python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
  File "C:\Python27\lib\urllib2.py", line 418, in _open
'_open', req)
  File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
  File "C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 370, in do_open
req)
  File "C:\Python27\lib\urllib2.py", line 1146, in do_open
h = http_class(host, timeout=req.timeout) # will parse host:port
  File "C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 78, in __init__
httplib.HTTPSConnection.__init__(self, *args, **kwargs)
  File "C:\Python27\lib\httplib.py", line 1149, in __init__
source_address)
  File "C:\Python27\lib\httplib.py", line 693, in __init__
self._set_hostport(host, port)
  File "C:\Python27\lib\httplib.py", line 721, in _set_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: 'port'
2012-10-22 16:55:29 (Process exited with code 1)

You can close this window now.

2 个答案:

答案 0 :(得分:1)

我将在前言中说我不熟悉GUI,所以请随意完全忽视:)。

错误似乎表明您正在尝试为部署指定特定端口,此外,该设置的值是“端口”一词。将commnand行与dev服务器一起使用时,port是一个参数,可用于指定要使用的特定端口;我最好的猜测是,当您尝试部署时,仍然会定义此关键字参数(如port)。是否有一个部分可以指定命令行标志?是否有可能在部署时定义port

答案 1 :(得分:0)

我通过完全卸载并重新安装Python 2.7和GAE来解决这个问题。此完整擦除应包括删除自您使用GAE以来设置的任何环境变量。

就我而言,我认为特别是环境代理变量的创建。完整的Python和GAE擦除解决了这个问题。