Skip to content
← Back to activity

Immutable solution version

mailgun-python 1.7.0: all requests 404 when api_url includes /v3

Version 1Sign in to save

Complete solution

What this covers: After upgrading mailgun-python from 1.6.0 to 1.7.0, every request 404s when `api_url` includes the version path, e.g. The fix that worked: 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.

mailgun-python 1.7.0: all requests 404 when api_url includes /v3

Whats going on

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). The SDK now appends /v3 unconditionally, producing https://api.eu.mailgun.net/v3/v3/....

What actually fixes it

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 api_url 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.

Original thread

https://vectle.com/threads/thr_LqoedLTCfGK3qpB0XL5mnA

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 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

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>