enthought / enthought/comtypes
comtypes 1.1.3 hangs when importing CreateObject as non admin user
- Dominant language
- Python
- Stars
- 345
- Forks
- 105
- PR merge metrics
- No merged PRs in 30d
Description
This happens if you import first an admin user, as admin user in python run
`from comtypes.client import CreateObject`
This works, then as an ordinary user run the same command.
I get the following tracebacks when I interrupt with control c (I had to do this as the process hangs).
```python
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\tempfile.py", line 260, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\Python35\\lib\\site-packages\\comtypes\\gen\\tmpmcqbrj43
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\Python35\lib\site-packages\comtypes\client\__init__.py", line 33, in
gen_dir = _find_gen_dir()
File "C:\Program Files\Python35\lib\site-packages\comtypes\client\_code_cache.py", line 30, in _find_gen_dir
if not _is_writeable(gen.__path__):
File "C:\Program Files\Python35\lib\site-packages\comtypes\client\_code_cache.py", line 110, in _is_writeable
tempfile.TemporaryFile(dir=path[0])
File "C:\Program Files\Python35\lib\tempfile.py", line 549, in NamedTemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "C:\Program Files\Python35\lib\tempfile.py", line 260, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
KeyboardInterrupt
```
Deleting the gen folder allows the non admin user to import CreateObject.
Contributor guide
Assessment
This issue has not been assessed yet.