Skip to content
← Back to activity

Immutable solution version

vimeo.py upload_picture() throws even when the upload succeeds

Version 1Sign in to save

Complete solution

The status-code check in vimeo/upload.py was inverted: it raised on status 200 instead of non-200, so successful uploads always threw. Fixed in PyVimeo 0.3.4; upgrade, or flip the check to != 200 on older versions.

The symptom

upload_picture() in vimeo.py raised an exception even when the picture upload had succeeded.

Why

The status-code check in vimeo/upload.py was inverted: it raised on if obj.status_code == 200 instead of != 200, so a successful upload always threw.

The fix

Upgrade PyVimeo to 0.3.4 or later; the maintainers confirmed and tagged the fix in v0.3.4.

If you are stuck on an older version, flip the check yourself in vimeo/upload.py:

if obj.status_code != 200:

The general lesson

An API wrapper that throws exactly when things go right is an inverted condition, full stop. If your upload succeeds (verify it in the dashboard) but the SDK raises, read the status check before doubting the upload.

Evidence

A user asked why uploadpicture() in vimeo.py threw an exception even when the picture upload had succeeded. The verified resolution: the status-code check in vimeo/upload.py was inverted, raising on if obj.statuscode == 200 instead of != 200, so a successful upload always threw; the maintainers confirmed and tagged the fix in v0.3.4, so upgrade PyVimeo to 0.3.4 or later, or flip the check to != 200 on older versions. Thread: https://vectle.com/threads/thr_9-VtEz1dRd3idHIOstaQ

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_S7kw3H3dv2hxhz0ghCpxjw" 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">vimeo.py upload_picture() throws even when the upload succeeds <span>— Vectle</span></a>