wireviz / WireViz

Easily document cables and wiring harnesses.
GNU General Public License v3.0
4.21k stars 219 forks source link

Help with OS Error #391

Open ElPi23 opened 1 week ago

ElPi23 commented 1 week ago

Hello everyone, I have received the following error and can't figure out what the problem is.

Error: ERROR: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Scripts\wireviz.exe\__main__.py", line 7, in File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\site-packages\wireviz\wv_cli.py", line 141, in wireviz wv.parse( File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\site-packages\wireviz\wireviz.py", line 88, in parse yaml_data, yaml_file = _get_yaml_data_and_path(inp) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\site-packages\wireviz\wireviz.py", line 416, in _get_yaml_data_and_path raise e File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\site-packages\wireviz\wireviz.py", line 406, in _get_yaml_data_and_path yaml_path = Path(inp).expanduser().resolve(strict=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\elias.pircher\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 1240, in resolve s = self._flavour.realpath(self, strict=strict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 730, in realpath OSError: _getfinalpathname: path too long for Windows

The YML file: YMLFILE.txt

I have already uninstalled and reinstalled wireviz without success i have also tried to save the file to a location with a shorter path without success

Wireviz version: 4.0 Graphviz version 11.0.0 (20240428.1522) Python 3.12.3

martinrieder commented 1 week ago

This should be fixed with the next release :

From the README: Installing the development version Access to the current state of the development branch can be gained by cloning the repo and installing manually:

git clone https://github.com/wireviz/WireViz
cd WireViz
git checkout release/v0.4.1-rc
pip3 install -e .

(replaced dev with release/v0.4.1-rc}

ElPi23 commented 1 week ago

i have installed the development version and when i use prependet file i still get the same error message.

it seems to have something to do with the length of the content of the .yml file because if i shorten it it works (even if i only delete comments)

martinrieder commented 1 week ago

I can confirm this bug. The exception is raised with e.errno as None. Thanks for reporting!

https://github.com/wireviz/WireViz/blob/ba84c54382b540dfa50dcd5e3592917abdbfb1f8/src/wireviz/wireviz.py#L419

Fixed in PR #392 by:

if type(e) is OSError and e.errno not in (EINVAL, ENAMETOOLONG, None):
kvid commented 1 week ago

@ElPi23 - Can you confirm that PR #392 solves your issue, or do you still get an error message?

ElPi23 commented 1 week ago

with the vesion wireviz-0.4.1.dev0 it does not work for me (i hope i did everything right i have never worked with git before)

I have done everything once again as described in the first comment of @martinrieder

martinrieder commented 1 week ago

@ElPi23 you need to checkout from here: https://github.com/martinrieder/WireViz/tree/bugfix/issue391 The easiest would be downloading the ZIP file from GH if you don't feel comfortable with using git. The PR that I created is not yet merged into the version that you got.

ElPi23 commented 1 week ago

Thank you can confirm that it is now working

many thanks for the fast and awesome support

martinrieder commented 1 week ago

@ElPi23 I recommend you install the GitHub CLI, which allows to easily checkout PRs like this in the future:

gh pr checkout 392

As I wrote in https://github.com/wireviz/WireViz/pull/392#issuecomment-2181727584, I still want to take a closer look at the root cause. Thanks again for reporting and also for confirming the fix!