Jump to solution
Verify

The Fix

pip install urllib3==1.25

Based on closed urllib3/urllib3 issue #974 · PR/commit linked

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Jump to Verify Open PR/Commit
@@ -49,6 +49,9 @@ test-all: requirements .PHONY: test-gae test-gae: requirements +ifndef GAE_PYTHONPATH + $(error GAE_PYTHONPATH must be set) +endif
repro.py
$ source venv/bin/activate $ make test-gae ... GLOB sdist-make: /home/nori/src/urllib3/setup.py gae inst-nodeps: /home/nori/src/urllib3/.tox/dist/urllib3-dev.zip gae installed: backports.ssl-match-hostname==3.5.0.1,certifi==2016.8.31,coverage==3.7.1,funcsigs==1.0.2,mock==1.3.0,nose==1.3.7,nose-exclude==0.4.1,NoseGAE==0.5.7,pbr==1.10.0,pkginfo==1.3.2,pluggy==0.3.1,py==1.4.31,PySocks==1.5.6,requests==2.11.1,six==1.10.0,tornado==4.2.1,tox==2.1.1,twine==1.5.0,urllib3===dev,virtualenv==15.0.3 gae runtests: PYTHONHASHSEED='1616590051' gae runtests: commands[0] | nosetests -c /home/nori/src/urllib3/test/appengine/nose.cfg test/appengine Traceback (most recent call last): File ".tox/gae/bin/nosetests", line 11, in <module> sys.exit(run_exit()) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/core.py", line 121, in __init__ **extra_args) File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__ self.parseArgs(argv) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/core.py", line 145, in parseArgs self.config.configure(argv, doc=self.usage()) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/config.py", line 346, in configure self.plugins.configure(options, self) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/plugins/manager.py", line 284, in configure cfg(options, config) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__ return self.call(*arg, **kw) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple result = meth(*arg, **kw) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nosegae.py", line 91, in configure import dev_appserver ImportError: No module named dev_appserver ERROR: InvocationError: '/home/nori/src/urllib3/.tox/gae/bin/nosetests -c /home/nori/src/urllib3/test/appengine/nose.cfg test/appengine' __________________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________________ ERROR: gae: commands failed
verify
Re-run: source venv/bin/activate Re-run: make test-gae
fix.md
Option A — Upgrade to fixed release\npip install urllib3==1.25\nWhen NOT to use: This fix is not applicable if the GAE_PYTHONPATH variable is intentionally unset for a reason.\n\n

Why This Fix Works in Production

  • Trigger: $ source venv/bin/activate
  • Mechanism: The GAE_PYTHONPATH environment variable was not set, causing an ImportError during tests
  • Why the fix works: Added a check in the Makefile to ensure that the GAE_PYTHONPATH environment variable is set before running the test-gae command. (first fixed release: 1.25).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • Shows up under Python 2.7 in real deployments (not just unit tests).
  • The GAE_PYTHONPATH environment variable was not set, causing an ImportError during tests
  • Surfaces as: $ source venv/bin/activate

Proof / Evidence

  • GitHub issue: #974
  • Fix PR: https://github.com/urllib3/urllib3/pull/975
  • First fixed release: 1.25
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.95
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.31

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“The GAE_PYTHONPATH environment variable has to be set for nosegae to work. For example: Perhaps we could update the Makefile to warn / error if…”
@theacodes · 2016-09-10 · source
“That would be a good idea, I'd merge a patch that does that! =)”
@Lukasa · 2016-09-10 · source
“@jonparrott I set the variable but still have the problem. Should I install google appengine by myself?”
@eungjun-yi · 2016-09-10 · source
“I installed google appengine and now it works well. Thanks!”
@eungjun-yi · 2016-09-10 · source

Failure Signature (Search String)

  • $ source venv/bin/activate

Error Message

Stack trace
error.txt
Error Message ------------- $ source venv/bin/activate $ make test-gae ... GLOB sdist-make: /home/nori/src/urllib3/setup.py gae inst-nodeps: /home/nori/src/urllib3/.tox/dist/urllib3-dev.zip gae installed: backports.ssl-match-hostname==3.5.0.1,certifi==2016.8.31,coverage==3.7.1,funcsigs==1.0.2,mock==1.3.0,nose==1.3.7,nose-exclude==0.4.1,NoseGAE==0.5.7,pbr==1.10.0,pkginfo==1.3.2,pluggy==0.3.1,py==1.4.31,PySocks==1.5.6,requests==2.11.1,six==1.10.0,tornado==4.2.1,tox==2.1.1,twine==1.5.0,urllib3===dev,virtualenv==15.0.3 gae runtests: PYTHONHASHSEED='1616590051' gae runtests: commands[0] | nosetests -c /home/nori/src/urllib3/test/appengine/nose.cfg test/appengine Traceback (most recent call last): File ".tox/gae/bin/nosetests", line 11, in <module> sys.exit(run_exit()) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/core.py", line 121, in __init__ **extra_args) File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__ self.parseArgs(argv) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/core.py", line 145, in parseArgs self.config.configure(argv, doc=self.usage()) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/config.py", line 346, in configure self.plugins.configure(options, self) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/plugins/manager.py", line 284, in configure cfg ... (truncated) ...

Minimal Reproduction

repro.py
$ source venv/bin/activate $ make test-gae ... GLOB sdist-make: /home/nori/src/urllib3/setup.py gae inst-nodeps: /home/nori/src/urllib3/.tox/dist/urllib3-dev.zip gae installed: backports.ssl-match-hostname==3.5.0.1,certifi==2016.8.31,coverage==3.7.1,funcsigs==1.0.2,mock==1.3.0,nose==1.3.7,nose-exclude==0.4.1,NoseGAE==0.5.7,pbr==1.10.0,pkginfo==1.3.2,pluggy==0.3.1,py==1.4.31,PySocks==1.5.6,requests==2.11.1,six==1.10.0,tornado==4.2.1,tox==2.1.1,twine==1.5.0,urllib3===dev,virtualenv==15.0.3 gae runtests: PYTHONHASHSEED='1616590051' gae runtests: commands[0] | nosetests -c /home/nori/src/urllib3/test/appengine/nose.cfg test/appengine Traceback (most recent call last): File ".tox/gae/bin/nosetests", line 11, in <module> sys.exit(run_exit()) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/core.py", line 121, in __init__ **extra_args) File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__ self.parseArgs(argv) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/core.py", line 145, in parseArgs self.config.configure(argv, doc=self.usage()) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/config.py", line 346, in configure self.plugins.configure(options, self) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/plugins/manager.py", line 284, in configure cfg(options, config) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__ return self.call(*arg, **kw) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple result = meth(*arg, **kw) File "/home/nori/src/urllib3/.tox/gae/lib/python2.7/site-packages/nosegae.py", line 91, in configure import dev_appserver ImportError: No module named dev_appserver ERROR: InvocationError: '/home/nori/src/urllib3/.tox/gae/bin/nosetests -c /home/nori/src/urllib3/test/appengine/nose.cfg test/appengine' __________________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________________ ERROR: gae: commands failed

Environment

  • Python: 2.7

What Broke

Running `make test-gae` resulted in an ImportError, preventing tests from executing.

Why It Broke

The GAE_PYTHONPATH environment variable was not set, causing an ImportError during tests

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install urllib3==1.25

When NOT to use: This fix is not applicable if the GAE_PYTHONPATH variable is intentionally unset for a reason.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/urllib3/urllib3/pull/975

First fixed release: 1.25

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if the GAE_PYTHONPATH variable is intentionally unset for a reason.

Verify Fix

verify
Re-run: source venv/bin/activate Re-run: make test-gae

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
  • Upgrade behind a canary and run integration tests against the canary before 100% rollout.
  • Add a TLS smoke test that performs a real handshake in CI (include CA bundle validation and hostname checks).
  • Alert on handshake failures by error string and endpoint to catch cert/CA changes quickly.

Version Compatibility Table

VersionStatus
1.25 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.