2012-10-20 60 views
2

在Windows 7上的Hello World應用程序運行新安裝的Trigger.io,我得到這個在做:Windows 7的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 
+0

這可能與[如果「env」參數包含unicode對象,爲什麼Popen在Windows上失敗?](http://stackoverflow.com/q/12253014/1309332)。你是否在你的環境中有任何unicode對象? – dbn

回答

-1

你指向文件時逃逸斜槓?例如:C:\文件夾\文件名而不是C:\文件夾\文件名?

+1

文件位置重複 – Brett

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(參數,標準輸出= subprocess.PIPE,標準錯誤= subprocess.STDOUT,ENV =無,preexec_fn = preexec_fn)

然後我的僞造網絡工作,我能夠運行它。但是,不完全確定這是「正確的」修復方法,但它會繼續下去。