truecrab / VSCode_Extension_Verilog

VSCode extension for enhancing verilog
24 stars 21 forks source link

python path badly build for unix, check the path for the python file! Is seems its calling with \ instead of / #4

Open ghost opened 4 years ago

ghost commented 4 years ago

python: can't open file '/home/helio/.vscode/extensions/truecrab.verilog-testbench-instance-0.0.5/outvTbgenerator.py': [Errno 2] No such file or directory

E011011101001 commented 4 years ago

+1

MeloMellow commented 4 years ago

yup

giothub-StefanTH commented 4 years ago

We need this fixed, here is more information

In the command window the following appear

~$ python /home/stefan/.vscode/extensions/truecrab.verilog-testbench-instance-0.0.5/out\vTbgenerator.py /home/stefan/Dokument/project/LEDDriver/LEDDriver.sv
python: can't open file '/home/stefan/.vscode/extensions/truecrab.verilog-testbench-instance-0.0.5/outvTbgenerator.py': [Errno 2] No such file or directory

As pointed out before the \ after "-testbench-instance-0.0.5/out" should be changed into a /

Further more, If the path is corrected and entered in the command window the following appear.


~$ python /home/stefan/.vscode/extensions/truecrab.verilog-testbench-instance-0.0.5/out/vTbgenerator.py /home/stefan/Dokument/project/LEDDriver/LEDDriver.sv
Traceback (most recent call last):
  File "/home/stefan/.vscode/extensions/truecrab.verilog-testbench-instance-0.0.5/out/vTbgenerator.py", line 224, in <module>
    writeTestBench(sys.argv[1])
  File "/home/stefan/.vscode/extensions/truecrab.verilog-testbench-instance-0.0.5/out/vTbgenerator.py", line 153, in writeTestBench
    with open(input_file, encoding=f_encoding) as inFile:
TypeError: 'encoding' is an invalid keyword argument for this function
giothub-StefanTH commented 4 years ago

There is a fox described here https://github.com/truecrab/VSCode_Extension_Verilog/issues/2

but it does not solve the second problem, a change to the python script /home/stefan/.vscode/extensions/truecrab.verilog-testbench-instance-0.0.5/out/vTbgenerator.py

line 224, change from " with open(input_file, encoding=f_encoding) as inFile:"

to " with open(input_file) as inFile:"

Then it at least output something

gxrao commented 4 years ago

For this issue: Modify the corresponding code in the file:~/.vscode-server/extensions/truecrab.verilog-testbench-instance-0.0.5/out/extension.js

line 23: ter1.sendText(python ${__dirname}/vInstance_Gen.py ${editor.document.fileName}); line 36 :ter1.sendText(python ${__dirname}/vTbgenerator.py ${editor.document.fileName});

AmnesiacGarden commented 4 years ago

For this issue: Just need to modify \\ to // , as follows: ter1.sendText(python ${__dirname}//vTbgenerator.py ${editor.document.fileName});

ARC-MX commented 2 years ago

I have fixed the bug of wrong execution path under different operating systems, and commit it.