MozillaSecurity / dharma

Generation-based, context-free grammar fuzzer. Refer to https://github.com/posidron/dharma for a maintained version.
Mozilla Public License 2.0
478 stars 90 forks source link

Path error on windows #27

Open zuypt opened 4 years ago

zuypt commented 4 years ago

I encounter this error when running dharma on Windows Traceback (most recent call last): File "d:\softwares\python\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "d:\softwares\python\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\softwares\Python\Python38\Scripts\dharma.exe\__main__.py", line 9, in <module> File "d:\softwares\python\python38\lib\site-packages\dharma\dharma.py", line 71, in main dharma.process_grammars(args.grammars) File "d:\softwares\python\python38\lib\site-packages\dharma\core\dharma.py", line 520, in process_grammars grammars.insert(0, open(os.path.relpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), File "d:\softwares\python\python38\lib\ntpath.py", line 703, in relpath raise ValueError("path is on mount %r, start on mount %r" % ( ValueError: path is on mount 'd:', start on mount 'E:'

Suggest fix: remove os.path.relpath in dharma.py:517 grammars.insert(0, open(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.path.normcase(path))))

jschwartzentruber commented 4 years ago

Thanks for reporting this. Would you be able to make a pull-request for your fix?

zuypt commented 4 years ago

Thanks for reporting this. Would you be able to make a pull-request for your fix?

sorry too much hassle for such a small change