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

Monkey patching error #2661

Closed
2 tasks done
egopal opened this issue Apr 1, 2024 · 3 comments
Closed
2 tasks done

Monkey patching error #2661

egopal opened this issue Apr 1, 2024 · 3 comments
Labels

Comments

@egopal
Copy link

egopal commented Apr 1, 2024

Prerequisites

Description

C:\Customs\python\python312\Lib\site-packages\locust_init_.py:15: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See gevent/gevent#1016. Modules that had direct imports (NOT patched): ['urllib3.util.ssl_ (C:\Customs\python\python312\Lib\site-packages\urllib3\util\ssl_.py)', 'urllib3.util (C:\Customs\python\python312\Lib\site-packages\urllib3\util\init.py)'].

Command line

locust -f mylocustfile.py -t 10s --headless

Locustfile contents

\locust\__init__.py:15: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util.ssl_ (C:\\Customs\\python\\python312\\Lib\\site-packages\\urllib3\\util\\ssl_.py)', 'urllib3.util (C:\\Customs\\python\\python312\\Lib\\site-packages\\urllib3\\util\\__init__.py)'].

Python version

3.12

Locust version

2.24.1

Operating system

Windows

@egopal egopal added the bug label Apr 1, 2024
@cyberw
Copy link
Collaborator

cyberw commented Apr 1, 2024

Make sure to import locust before other imports.

@egopal
Copy link
Author

egopal commented Apr 3, 2024

it fixed, thanks

@egopal
Copy link
Author

egopal commented Apr 3, 2024

issue does not appear after moving the import locust to the begining

@egopal egopal closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants