Windows 7 Trigger.io错误:环境只能包含字符串

时间:2012-10-20 16:51:31

标签: trigger.io

在Windows 7中的hello world应用程序上运行新安装的Trigger.io,我这样做:

    forge run web


File "C:\Users\john.jesus\AppData\Local\Trigger Toolkit\build-tools\forge\async.py", line 96, in run
result = self._target(*self._args, **self._kwargs)
File "C:\Users\john.jesus\AppData\Local\Trigger Toolkit\build-tools\forge\main.py", line 437, in run
build_to_run=build_to_run,
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\customer_goals.py", line 124, in run_app
build_to_run.run()
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\build.py", line 337, in run
self._call_with_params(task_method, task_args)
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\build.py", line 296, in _call_with_params
return method(self, *params)
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\web_tasks.py", line 141, in run_web
env=dict(os.environ, PORT=str(port), FORGE_DEBUG='1'))
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\web_tasks.py", line 98, in _node
run_shell(node, *args, **kw)
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\utils.py", line 338, in run_shell
raise state.error

TypeError: environment can only contain strings

2 个答案:

答案 0 :(得分:0)

我有完全相同的问题 - 似乎是因为Python无法处理POpen的环境字典中的unicode。这里有更多信息:

Why does Popen fail on Windows if the "env" parameter contains a unicode object?

我编辑了

C:\用户\ mattc \锐意工作空间\原型app.template \ generate_dynamic \ module_dynamic \ utils.py

并更改了第304行以删除环境变量的传递,因此我有:

state.proc = lib.PopenWithoutNewConsole(args,stdout = subprocess.PIPE,stderr = subprocess.STDOUT,env = None,preexec_fn = preexec_fn)

然后我的forge-web工作了,我能够运行它。但是,并不完全确定这是“正确的”解决方案,但它会让它继续下去。

答案 1 :(得分:-1)

指向文件时是否转义斜杠?例如:C:\ folder \ filename而不是C:\ folder \ filename?