2,266 questions
2 votes
1 answer
70 views
Can't use lock around gather in Python asyncio
For some reason, this code doesn't work on Ubuntu 20, Python 3.8.10, unless the .gather line is commented out. It works on Ubuntu 24, Python 3.12.3 and Windows 11, Python 3.13.9. It doesn't work on ...
0 votes
0 answers
209 views
Starlette/FastAPI Default Exception Handler Overriding Error [duplicate]
I'm trying to override the default exception handler in a FastAPI application so I can log any exceptions that happen. The problem that I run into is that my handler seems to run as it logs what I ...
0 votes
0 answers
68 views
Building wheel for mysqlclient (pyproject.toml) did not run successfully
I'm trying to install mysqldb on python3.8 (Windows 11 24H2). I initially had issues with VSC++14 but I managed to solve them. pip install -U flask_mysqldb error: subprocess-exited-with-error ...
0 votes
2 answers
76 views
Mock a module that export a class in python
We're working on a message-based communication mechanism. We have several classes that manage incoming messages and send outgoing messages at a high level (Commands, Queries, and Events). Underneath, ...
-2 votes
1 answer
215 views
How to set up same SSLContext in Python 3.8 through 3.13? [closed]
My code so far: def _ssl_context(self, ca: str | None) -> ssl.SSLContext: # NOTE: ssl.create_default_context() doesn't allow setting the context.protocol in a way # that's the ...
-2 votes
1 answer
327 views
Object is not subscriptable in Scrapy Fake User Agent
I got this error: from fake_useragent import UserAgent File "D:\Kerja\HIT\Python Projects\Ongoing Projects\Andrew Mancilla\mancilla-env\lib\site-packages\fake_useragent\__init__.py", ...
0 votes
1 answer
75 views
Why I am unable to create connection with MySQL using python
The program terminates automatically without throwin any error or output The port and connector working fine and details are given below C:\Users\jsr>pip list Package Version --------...
-1 votes
1 answer
49 views
ModuleNotFoundError when referencing folder in Python [duplicate]
I have a Python3 project arranged as follows: C:\automation\framework\constants.py C:\automation\tests\unit-tests\test_myunittest.py In my unit test, I'm trying to call methods in framework folder, ...