Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[retry mechanism(?)]: "The system cannot open the device or file specified." #8138

Closed
bersbersbers opened this issue Dec 2, 2023 · 1 comment · Fixed by #8139
Closed
Labels
triage Please triage and relabel this issue

Comments

@bersbersbers
Copy link
Contributor

Description of the issue

I cannot reproduce the issue, but I was getting the stacktrace below, and I believe that is a case caused by AntiVirus software but not (sufficiently) handled by the existing retry mechanism.

Context information (for bug reports)

  • Output of pyinstaller --version: 6.2.0
  • Version of Python: 3.11.6
  • Platform: Windows 10 22H2
  • How you installed Python: scoop + virtualenv
  • Did you also try this on another platform? Does it work there? No

Stacktrace / full error message

Traceback (most recent call last):
  File "c:\Build\project\.venv\Lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 33, in pywin32error
    yield
  File "c:\Build\project\.venv\Lib\site-packages\win32ctypes\pywin32\win32api.py", line 226, in EndUpdateResource
    _resource._EndUpdateResource(handle, discard)
  File "c:\Build\project\.venv\Lib\site-packages\win32ctypes\core\ctypes\_util.py", line 61, in check_false
    raise make_error(function, function_name)
OSError: [WinError 110] The system cannot open the device or file specified.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "c:\Build\project\.venv\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\__main__.py", line 214, in _console_script_run
    run()
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\__main__.py", line 198, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\__main__.py", line 69, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\building\build_main.py", line 1069, in main
    build(specfile, distpath, workpath, clean_build)
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\building\build_main.py", line 1009, in build
    exec(code, spec_namespace)
  File "project.spec", line 52, in <module>
    exe = EXE(
          ^^^^
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\building\api.py", line 628, in __init__
    self.__postinit__()
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\building\datastruct.py", line 184, in __postinit__
    self.assemble()
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\building\api.py", line 737, in assemble
    self._retry_operation(winresource.remove_all_resources, build_name)
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\building\api.py", line 995, in _retry_operation
    return func(*args)
           ^^^^^^^^^^^
  File "c:\Build\project\.venv\Lib\site-packages\PyInstaller\utils\win32\winresource.py", line 189, in remove_all_resources
    win32api.EndUpdateResource(module_handle, False)
  File "c:\Build\project\.venv\Lib\site-packages\win32ctypes\pywin32\win32api.py", line 225, in EndUpdateResource
    with _pywin32error():
  File "c:\Scoop\apps\python311\current\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "c:\Build\project\.venv\Lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
    raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (110, 'EndUpdateResourceW', 'The system cannot open the device or file specified.')
@bersbersbers bersbersbers added the triage Please triage and relabel this issue label Dec 2, 2023
@rokm
Copy link
Member

rokm commented Dec 2, 2023

Looks like we need to add WinError 110 to _ALLOWED_WINERROR.

@rokm rokm closed this as completed in #8139 Dec 2, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage Please triage and relabel this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants