question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why am I getting: OSError: [WinError 110] The system cannot open the device or file specified

See original GitHub issue

I have a too-large-to-touch project, where if I use --follow-imports, the compilation fails with OSError: [WinError 110] The system cannot open the device or file specified. If I use --follow-import-to=my.python.files.path, or don’t use any follow import, then the compilation is successful. Binary file is created even upon fail, but won’t do anything. (It runds and closes without any stdout.)

version

0.6.10.5 Python: 3.6.12 |Anaconda, Inc.| (default, Sep 9 2020, 00:29:25) [MSC v.1916 64 bit (AMD64)] Executable: C:\Users\uname.conda\envs\project\python.exe OS: Windows Arch: x86_64

Installed it with conda install nuitka, which downloaded Nuitka from a corporate repository. I cannot get newer version of it.

detailed output of the compilation

(project) C:\Users\uname\source\repos\project_dir>nuitka main.py --follow-imports
Nuitka:INFO: Starting Python compilation.
Nuitka-Plugins:WARNING: Use '--plugin-enable=pylint-warnings' for: Understand PyLint/PyDev annotations for warnings.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating C source code for backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C level backend compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: C:\Users\uname\AppData\Local\Nuitka\Nuitka\gcc\x86_64\10.2.0-11.0.0-8.0.0-r5\mingw64\bin\gcc.exe (gcc.exe).
Nuitka-Scons:INFO: Compiled 810 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache hit (direct)': 810
Traceback (most recent call last):
  File "C:\Users\uname\.conda\envs\project\lib\site-packages\nuitka\main.py", line 196, in <module>
    main()
  File "C:\Users\uname\.conda\envs\project\lib\site-packages\nuitka\main.py", line 189, in main
    MainControl.main()
  File "C:\Users\uname\.conda\envs\project\lib\site-packages\nuitka\MainControl.py", line 713, in main
    executePostProcessing()
  File "C:\Users\uname\.conda\envs\project\lib\site-packages\nuitka\PostProcessing.py", line 228, in executePostProcessing
    lang_id=0,
  File "C:\Users\uname\.conda\envs\project\lib\site-packages\nuitka\utils\WindowsResources.py", line 263, in addResourceToFile
    closeFileWindowsResources(updatehandle)
  File "C:\Users\uname\.conda\envs\project\lib\site-packages\nuitka\utils\WindowsResources.py", line 182, in _closeFileWindowsResources
    raise ctypes.WinError()
OSError: [WinError 110] The system cannot open the device or file specified.
(project) C:\Users\uname\source\repos\project_dir>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Jan 14, 2021

It’s unrelated to those options, it’s happening sporadically, basically it is a race. If you try it often enough under different load situations, it might work eventually. What I am trying is to add a retry code in the portion of Nuitka that fails there, do it 5 times, waiting a second, hoping for Windows Defender to unlock the file in the mean time.

But for now, you are indeed stuck with this. Few people have this reproducibly it seems.

0reactions
kayhayencommented, Jan 18, 2021

Like I said, I changed this to a retry with a warning and that should make this obsolete as a question, as that error won’t happen anymore, instead it’s an enhancement. Not sure if retry will actually help, but at least error text will output what is to be done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EndUpdateResource() throws Error 110 The system cannot ...
EndUpdateResource() throws Error 110 The system cannot open the device or file specified when windowsexplorer is open at the output location.
Read more >
How to fix Error 110 (ERROR_OPEN_FAILED) - The system ...
This article features error number Code 110, commonly known as ERROR_OPEN_FAILED and it is described as The system cannot open the device or...
Read more >
The system cannot open the device or file specified
Error message "The system cannot open the device or file specified" is displayed during the installation of Autodesk software.
Read more >
Pyinstaller can't access files : r/learnpython - Reddit
I am on windows 10, have python 3.7 installed from the microsoft ... OSError: [WinError 1920] The file cannot be accessed by the...
Read more >
Why am I getting: OSError: [WinError 110] The system cannot ...
Why am I getting: OSError: [WinError 110] The system cannot open the device or file specified ... I have a too-large-to-touch project, where...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found