2

尝试运行 Pyramid 项目时出现以下错误。据我所知,这在一夜之间出现了,我不知道如何开始调试它:

C:\mas\mas>..\Scripts\pserve.exe serve development.ini --reload
Starting subprocess with file monitor
Traceback (most recent call last):
  File "C:\mas\Scripts\pserve-script.py", line 8, in <module>
    load_entry_point('pyramid==1.3.2', 'console_scripts', 'pserve')()
  File "C:\mas\lib\site-packages\pyramid-1.3.2-py2.7.egg\pyramid\scripts\pserve.
py", line 47, in main
    return command.run()
  File "C:\mas\lib\site-packages\pyramid-1.3.2-py2.7.egg\pyramid\scripts\pserve.
py", line 221, in run
    vars = self.parse_vars(restvars)
  File "C:\mas\lib\site-packages\pyramid-1.3.2-py2.7.egg\pyramid\scripts\pserve.
py", line 330, in parse_vars
    % arg)
ValueError: Variable assignment 'development.ini' invalid (no "=")

有什么问题,或者我应该如何确定它?抱歉,我的问题相当含糊,但如果我对我所问的问题有更多了解,我可能已经在 Google 上找到了答案:)。

第 328 - 330 行:

        raise ValueError(
            'Variable assignment %r invalid (no "=")'
            % arg)

开发.ini

[app:main]
use = egg:mas

pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes = pyramid_debugtoolbar
    pyramid_tm
    pyramid_beaker

sqlalchemy.url = sqlite:///%(here)s/mas.db

# Cache settings
cache.regions = default_term, second, short_term, long_term
cache.type = memory
cache.second.expire = 1
cache.short_term.expire = 60
cache.default_term.expire = 300
cache.long_term.expire = 3600

# Beaker sessions
#session.type = file
#session.data_dir = %(here)s/data/sessions/data
#session.lock_dir = %(here)s/data/sessions/lock
session.type = memory
session.key = akhet_demo
session.secret = 0cb243f53ad865a0f70099c0414ffe9cfcfe03ac

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543

# Begin logging configuration

[loggers]
keys = root, mas, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_mas]
level = DEBUG
handlers =
qualname = mas

[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

# End logging configuration
4

2 回答 2

3

Ich,我已经解决了,我在错误的地方寻找问题。问题是这个命令:

..\Scripts\pserve.exe serve development.ini --reload

应该是这个命令:

..\Scripts\pserve.exe development.ini --reload

我不知道我的批处理文件是如何或何时更改的,但是如果有人遇到类似的问题,希望这会有所帮助。

于 2012-07-17T02:59:04.367 回答
2

看来您的参数顺序是倒序的 - 它应该是:

..\Scripts\pserve.exe development.ini --reload
于 2012-07-17T02:41:55.787 回答