python中的Win206错误

2024-04-20 13:27:40 发布

您现在位置:Python中文网/ 问答频道 /正文

        Traceback (most recent call last):
 File "C:\Python34\vp\pycparser\__init__.py", line 44, in preprocess_file
universal_newlines=True)
 File "C:\Python34\lib\subprocess.py", line 859, in __init__
  restore_signals, start_new_session)
 File "C:\Python34\lib\subprocess.py", line 1112, in _execute_child
  startupinfo)
 FileNotFoundError: [WinError 206] The filename or extension is too long

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
  File "vp/task3.py", line 250, in <module>
   debugs(c_file,root,"vp/log.txt",inc)
  File "vp/task3.py", line 86, in debugs
   ast = parse_file(filename, use_cpp=True,cpp_path='gcc',cpp_args=['-E','-      std=
  c99','-nostdinc', include])
  File "C:\Python34\vp\pycparser\__init__.py", line 86, in parse_file
   text = preprocess_file(filename, cpp_path, cpp_args)
 File "C:\Python34\vp\pycparser\__init__.py", line 49, in preprocess_file
('Original error: %s' % e))
RuntimeError: Unable to invoke 'cpp'.  Make sure its path was passed    correctly
Original error: [WinError 206] The filename or extension is too long

 include=incl
 ast = parse_file(filename, use_cpp=True,cpp_path='gcc',cpp_args=['-E','-     std=c99','-nostdinc', include])

我正在向pycparser中的cpp_args传递一个包含目录的列表,这些是我遇到的一些错误,有没有解决上述问题的方法,或者我需要包含一个包含目录的原始字符串?在


Tags: pathinpytrueinitlineargsfilename