Basic Information:
Klipper master from git
Describe your issue:
virtual_sdcard file open
Traceback (most recent call last):
File "klipper/klippy/extras/virtual_sdcard.py", line 184, in _load_file
fname = files_by_lower[fname.lower()]
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'test.nc'
Unable to open file
To reproduce start with an empty gcode directory. Then upload a file with any extension that isn’t a “valid” gcode file. For example a file xxxx.nc
which is a common extension that Klipper doesn’t recognize. Then select print file and it will get an “unable to open file” error which is misleading.
I only looked briefly at the code and I don’t really understand what the purpose of that code is. It’s creating a list of files then checking if the file selected to print is in that list so you end up in a situation where the file exists but it’s not in the list. If there are no valid files then it will get a confusing error because the list is empty.
The error message should reflect that the selected file has an invalid extension or something similar. Also, I request that “nc” be added as a valid extension.