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.

Access violation in Python 3.9

See original GitHub issue

Hello, To be quite honest, I’m not sure whether to report it here or on comtypes GitHub page, as I’m not that familiar with either of the repositories, and importing comtypes by itself works just fine.

Expected Behavior

Importing pywinauto works without issues

Actual Behavior

Importing pywinauto causes access violation issues on Windows

Steps to Reproduce the Problem

  1. Install Python 3.9
  2. Install pywinauto
  3. Import pywinauto in your script

Short Example of Code to Demonstrate the Problem

import faulthandler
import pywinauto
faulthandler.enable()

which then results in the following:

Windows fatal exception: code 0x80010108

Thread 0x00002358 (most recent call first):
  File "C:\Python39\lib\site-packages\comtypes\__init__.py", line 180 in _shutdown
Windows fatal exception: code 0x80010108

Thread 0x00002358 (most recent call first):
  File "C:\Python39\lib\site-packages\comtypes\__init__.py", line 180 in _shutdown

Specifications

  • Pywinauto version: 0.6.8
  • Python version and bitness: 3.9.5 x64
  • Platform and OS: Win 10x64

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
prokmicommented, Jun 4, 2021

For the time being, I thought of a workaround of just atexit.unregister(comtypes._shutdown). How unsafe is it?

0reactions
vasily-v-ryabovcommented, Jul 23, 2021

Oh, wait! comtypes calls only atexit.register(_shutdown) while atexit.unregister(_shutdown) fixes the problem. So in fact we unregister correct handler which fails. Still not good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows fatal exception: access violation - Python Help
I'm using python 3.9.5 and I'm packing my app using pyarmor + pyinstaller. I've been using these tools for a very long time...
Read more >
When using Yolov5 and Python 3.9.7 I get "Process finished ...
I have tried all of the answers that reference "exit code -1073741819 (0xC0000005)" (Which means access violation) but none of them work.
Read more >
Access Violation python39.dll - Delphi-PRAXiS [en]
I'm using Delphi 10.4.2 and Python4Delphi with Python 3.9.2 Win64. I have the error "Access Violation at address in module python39.dll".
Read more >
Problem plotting PlotShape - Neuron.yale.edu
_data)) OSError: exception: access violation reading ... I am running Python 3.9.4 with NEURON 8.0 installed via pip on Windows 10.
Read more >
Error when viewing GeoDataFrame in GeoPandas: "OSError
...with Python 3.9, GDAL 3.4.3, Fiona 1.8.21, Geopandas 0.10.2 in a Conda environment (and finally I used PostGIS to do what I wanted...
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