Skip to content

Fix: Compatibility with urllib3 v2.0+ and Python 3.11+#125

Open
arielsaghiv wants to merge 2 commits into
AstroPrint:masterfrom
arielsaghiv:master
Open

Fix: Compatibility with urllib3 v2.0+ and Python 3.11+#125
arielsaghiv wants to merge 2 commits into
AstroPrint:masterfrom
arielsaghiv:master

Conversation

@arielsaghiv
Copy link
Copy Markdown

Problem

The current version hard-locks urllib3 < 2.0.0. On modern systems (Python 3.11+), urllib3 v2.0 removed urllib3.contrib.appengine, causing a hard ImportError when requests-toolbelt is initialized.

Solution

  • Updated setup.py to allow requests-toolbelt >= 1.0.0 and urllib3 up to v3.
  • Added a try/except block in AstroprintCloud.py to handle the ImportError gracefully on modern stacks.

Verification

Verified working on OctoPrint 1.11.7 running Python 3.11.2 and urllib3 2.7.0.

crash on latest octoprint 1.11.7 - Update setup.py dependencies for urllib3 v2
Handle ImportError for requests_toolbelt and adjust import statement. Add fallback for requests-toolbelt import error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant