Page MenuHomePhabricator

Can not upload a file
Closed, DuplicatePublic


I can't upload a file to commons, I'm receiving this error:

To upload I'm using this line: site.upload(page, 'refs.png', comment=u'update to %s' % useddump)

Event Timeline

Danilo created this task.Aug 29 2016, 10:00 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptAug 29 2016, 10:00 PM
Teles added a subscriber: Teles.Sep 2 2016, 5:37 PM
Sleeping for 7.3 seconds, 2016-08-29 17:55:47
ERROR: Traceback (most recent call last):
  File "/shared/pywikipedia/core/pywikibot/data/", line 1954, in submit
    body=body, headers=headers)
  File "/shared/pywikipedia/core/pywikibot/tools/", line 1417, in wrapper
    return obj(*__args, **__kw)
  File "/shared/pywikipedia/core/pywikibot/comms/", line 279, in request
    r = fetch(baseuri, method, body, headers, **kwargs)
  File "/shared/pywikipedia/core/pywikibot/comms/", line 434, in fetch
  File "/shared/pywikipedia/core/pywikibot/comms/", line 352, in error_handling_callback
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 678: ordinal not in range(128)

This looks really similar to T99366

@Danilo Wondering if the version of pywikibot you use is up to date.

Danilo added a comment.Oct 7 2016, 2:43 AM

I am using the pywikibot that is in Tool Labs, I put this in my env:

And python /shared/pywikipedia/core/ version returns:
Pywikibot: [https] r-pywikibot-core.git (e6fc134, g2, 2016/10/05, 17:43:42, n/a)

I tested in my pc and I got upload to testwiki:

But when I try to upload at Tool Labs I still get the same error, and I need to run it in Tool Labs, because the script uses the history dumps there.