gpt4 book ai didi

python - Google App Engine 部署错误 : Bogus Escape

转载 作者:行者123 更新时间:2023-11-30 23:09:25 25 4
gpt4 key购买 nike

我正在尝试通过运行以下命令将 PHP 网站部署到 Google App Engine:

appcfg.py -A <app-id> update <app-location>

我不断收到以下错误:

Traceback (most recent call last):

...

line 327, in __GetMimeTypeIfStaticFile
if re.match(regex, filename):
File "C:\python27\lib\re.py", line 137, in match
return _compile(pattern, flags).match(string)
File "C:\python27\lib\re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: bogus escape: '\\1'

我不确定是否存在 Python 无法识别的 MIME 类型,或者是否有某些文件被 Google 阻止。我尝试浏览部署代码,但我必须查找大量引用资料。有人有什么想法吗?

完整堆栈跟踪:

Traceback (most recent call last):
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform/google_appengine\appcfg.py", line 133, in <module>
run_file(__file__, globals())
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform/google_appengine\appcfg.py", line 129, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 5511, in <module>
main(sys.argv)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 5502, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 3021, in Run
self.action(self)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 5158, in __call__
return method()
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 3880, in Update
self._UpdateWithParsedAppYaml(appyaml, self.basepath)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 3933, in _UpdateWithParsedAppYaml
self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 3818, in UpdateVersion
return appversion.DoUpload(paths, openfunc)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 2441, in DoUpload
self._AddFilesThatAreSmallEnough(paths, openfunc)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 2540, in _AddFilesThatAreSmallEnough
self.config, path, self.error_fh)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 298, in __init__
self.__static_mime_type = self.__GetMimeTypeIfStaticFile(config, filename)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 327, in __GetMimeTypeIfStaticFile
if re.match(regex, filename):
File "C:\python27\lib\re.py", line 137, in match
return _compile(pattern, flags).match(string)
File "C:\python27\lib\re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: bogus escape: '\\1'

以下是我的 app.yaml 文件的内容:

application: <app-id>
version: 1
runtime: php55
api_version: 1
threadsafe: yes

handlers:

- url: /(.*\.(css|js|png|jpg|jpeg|ttf|woff|xsl|htm|html|ico).*)$
static_files: \1
upload: \1

- url: /(.+\.php)$
script: \1

- url: /(.+)/$
script: \1/default.php

- url: /(.+)$
script: \1.php

- url: /|/default.php
script: default.php

最佳答案

您不能使用匹配的组 (\1) 作为静态处理程序的 upload: 部分的值 - 它需要准确地知道哪些文件上传到静态服务器。

关于python - Google App Engine 部署错误 : Bogus Escape,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31225174/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com