You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nimi-python has a number of API functions that take paths, such as import_attribute_configuration_file and nidigital's load_pin_map, load_specifications_levels_and_timing, and load_pattern.
Most of these only accept str. Some also accept Iterable[str].
pathlib has been part of the Python standard library since Python 3.4, so it would be nice if nimi-python supported it.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\dev\measurementlink-python\examples\nidigital_spi\.venv\lib\site-packages\nidigital\session.py", line 41, in aux
return f(*xs, **kws)
File "D:\dev\measurementlink-python\examples\nidigital_spi\.venv\lib\site-packages\nidigital\session.py", line 3683, in load_pin_map
self._interpreter.load_pin_map(file_path)
File "D:\dev\measurementlink-python\examples\nidigital_spi\.venv\lib\site-packages\nidigital\_library_interpreter.py", line 729, in load_pin_map
file_path_ctype = ctypes.create_string_buffer(file_path.encode(self._encoding)) # case C020
AttributeError: 'WindowsPath' object has no attribute 'encode'
load_specifications_levels_and_timing error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\dev\measurementlink-python\examples\nidigital_spi\.venv\lib\site-packages\nidigital\session.py", line 41, in aux
return f(*xs, **kws)
File "D:\dev\measurementlink-python\examples\nidigital_spi\.venv\lib\site-packages\nidigital\session.py", line 3451, in load_specifications_levels_and_timing
self._call_method_with_iterable(self._load_specifications, specifications_file_paths)
File "D:\dev\measurementlink-python\examples\nidigital_spi\.venv\lib\site-packages\nidigital\session.py", line 3460, in _call_method_with_iterable
for f in files:
TypeError: 'WindowsPath' object is not iterable
```
### Workaround
Call `str(...)` on `Path` objects before passing them to nimi-python.
The text was updated successfully, but these errors were encountered:
Description of issue
nimi-python has a number of API functions that take paths, such as
import_attribute_configuration_file
andnidigital
'sload_pin_map
,load_specifications_levels_and_timing
, andload_pattern
.Most of these only accept
str
. Some also acceptIterable[str]
.pathlib
has been part of the Python standard library since Python 3.4, so it would be nice if nimi-python supported it.System report
python -c "import nidigital; nidigital.print_diagnostic_information()"
outputSteps to reproduce issue
load_pin_map
error:load_specifications_levels_and_timing
error:The text was updated successfully, but these errors were encountered: