AcademySoftwareFoundation / AcademySoftwareFoundation/OpenShadingLanguage
[BUG] On Windows, liboslquery will have errors on import with invalid PATH variables
- Lingua principale
- C++
- Stelle
- 2.3k
- Fork
- 414
- Merge medio
- 3g 1h
- PR unite (30g)
- 10
Descrizione
**Describe the bug**
When running `import oslquery` in Python, and you have a invalid path like `C:` in your environment variables, you will get a error.
**To Reproduce**
On Windows:
- Add `C:` to `PATH`
- Important, it needs to be `C:` and not `C:\`
- Run a Python script that imports liboslquery. The simplest way is to just run https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/liboslquery/__init__.py directly.
- Notice you get a error message
**Evidence**
Error message:
````
Traceback (most recent call last):
File "/path/to/oslquery/__init__.py", line 10, in
os.add_dll_directory(path)
~~~~~~~~~~~~~~~~~~~~^^^^^^
File "", line 1165, in add_dll_directory
OSError: [WinError 87] The parameter is incorrect: 'C:'
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con src/liboslquery/__init__.py e riproduci l’importazione su Windows con C: incluso in PATH. Verifica la gestione di questa voce di PATH e conferma che l’importazione di liboslquery riesca senza l’eccezione WinError 87.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- operating-systems
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 68/100