Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 谷歌应用服务器中的yaml异常;无法将testProject添加到属性应用程序";正则表达式问题?_Python_Google App Engine_Yaml - Fatal编程技术网

Python 谷歌应用服务器中的yaml异常;无法将testProject添加到属性应用程序";正则表达式问题?

Python 谷歌应用服务器中的yaml异常;无法将testProject添加到属性应用程序";正则表达式问题?,python,google-app-engine,yaml,Python,Google App Engine,Yaml,谷歌应用引擎的第一天 我的yaml文件包括以下内容: application: testProgram version: 1 runtime: python api_version: 1 handlers: - url: /.* script: main.py libraries: - name: webapp2 version: "2.5.2" ile "/home/rickus/google_appengine/google/appengine/api/yaml_listene

谷歌应用引擎的第一天

我的yaml文件包括以下内容:

application: testProgram
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
  script: main.py

libraries:
- name: webapp2
  version: "2.5.2"
ile "/home/rickus/google_appengine/google/appengine/api/yaml_listener.py", line 178, in _HandleEvents
    raise yaml_errors.EventError(e, event_object)
google.appengine.api.yaml_errors.EventError: Unable to assign value 'testProgram' to attribute 'application':
Value 'testProgram' for application does not match expression '^(?:(?:[a-z\d\-]{1,100}\~)?(?:(?!\-)[a-z\d\-\.]{1,100}:)?(?!-)[a-z\d\-]{0,99}[a-z\d])$'
  in "testProgram/app.yaml", line 1, column 14
我的python文件包括以下内容(仅供参考):

我得到的错误如下:

application: testProgram
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
  script: main.py

libraries:
- name: webapp2
  version: "2.5.2"
ile "/home/rickus/google_appengine/google/appengine/api/yaml_listener.py", line 178, in _HandleEvents
    raise yaml_errors.EventError(e, event_object)
google.appengine.api.yaml_errors.EventError: Unable to assign value 'testProgram' to attribute 'application':
Value 'testProgram' for application does not match expression '^(?:(?:[a-z\d\-]{1,100}\~)?(?:(?!\-)[a-z\d\-\.]{1,100}:)?(?!-)[a-z\d\-]{0,99}[a-z\d])$'
  in "testProgram/app.yaml", line 1, column 14

所以它在抱怨我文件的命名?不可能吧?我有什么想法吗?

它很可能会抱怨你的应用程序ID,看看正则表达式,它只接受小写字符


将您的应用程序ID更改为“testprogram”或“testprogram”

因为我花了这么多时间做这样一件蠢事。非常感谢。拥抱和亲吻。我会接受并投票支持你的回答当然它可能是对的它在抱怨你的程序名,它不能包含大写字符(可能是为了防止这些不可读的骆驼字)@Anthon it最肯定是,我只是感到震惊。我甚至没有意识到这是我遇到的问题,我想都没想。我不知道是否还有其他解释,但由于处理YAML文件的软件是Python(从错误消息的格式中扣除),程序员似乎应用了Python的“规则”(即在多单词名称下使用
)。当然,可能是应用商店所在的底层文件系统不区分大小写…@Anthon使用小写字母的原因是,您可以将代码推送到.appspot.com,并在谷歌的服务器上运行。因为URL不区分大小写,所以只允许用“-”分隔a-z是非常合理的s@shravster谢谢你的解释。我想你的意思是说域名不区分大小写,URL当然可以区分大小写。