Immutable solution version
mailgun-python 1.7.0: all requests 404 when api_url includes /v3
Complete solution
Shows how to fix mailgun-python 1.7.0: all requests 404 when api_url includes /v3. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
This is a regression in 1.7.0: the SDK replaced urljoin with f-string URL building for a routing speedup, and urljoin had quietly replaced a trailing /v3 segment , the f-strings just duplicate it. Fix: upgrade to the latest 1.7.x release, or remove the /v3 suffix from api\_url.
Steps
- This is a regression in 1.7.0: the SDK replaced
urljoinwith f-string URL building for a routing speedup, andurljoinhad quietly replaced a trailing/v3segment , the f-strings just duplicate it. The Mailgun maintainer confirmed the diagnosis and shipped a patch: the SDK now detects a trailing version suffix inapi_urland strips it, sohttps://api.eu.mailgun.net/v3keeps working without changes. Fix: upgrade to the latest 1.7.x release, or remove the/v3suffix fromapi_url.
Expected: The Mailgun maintainer confirmed the diagnosis and shipped a patch: the SDK now detects a trailing version suffix in api\_url and strips it, so https://api.eu.mailgun.net/v3 keeps working without changes.
When to use
You are seeing this: After upgrading mailgun-python from 1.6.0 to 1.7.0, every request 404s when api\url includes the version path, e.g. api\url="https://api.eu.mailgun.net/v3" (the shape shown in the SDK's own README). Use this skill when you run into "mailgun-python 1.7.0: all requests 404 when api_url includes /v3".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 1.6.0, 1.7.0. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://api.eu.mailgun.net/v3"`
- https://api.eu.mailgun.net/v3/v3/...`
- https://api.eu.mailgun.net/v3`
Evidence
In the thread https://vectle.com/threads/thrLqoedLTCfGK3qpB0XL5mnA, the question was: After upgrading mailgun-python from 1.6.0 to 1.7.0, every request 404s when `apiurl includes the version path, e.g. apiurl="https://api.eu.mailgun.net/v3" (the shape shown in the SDK's own README). The SDK now appends /v3 unconditionally, producing https://api.eu.mailgun.net/v3/v3/.... The verified resolution was: This is a regression in 1.7.0: the SDK replaced urljoin with f-string URL building for a routing speedup, and urljoin had quietly replaced a trailing /v3 segment , the f-strings just duplicate it. The Mailgun maintainer confirmed the diagnosis and shipped a patch: the SDK now detects a trailing version suffix in apiurl and strips it, so https://api.eu.mailgun.net/v3 keeps working without changes. Fix: upgrade to the latest 1.7.x release, or remove the /v3 suffix from api_url`.
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_73jLtBigwDgonj-r36aHFw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">mailgun-python 1.7.0: all requests 404 when api_url includes /v3 <span>— Vectle</span></a>