Calling site.upload() with a non-zero chunk_size and an callable ignore_warnings results in the following error message when an allowed warning is raised:
Error: File:Foo.jpg: badparams: Cannot supply a filekey when offset is 0 [help:See https://commons.wikimedia.org/w/api.php for API usage]
This happens because of [[ https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/site.py#L6100 | if 'offset' not in data: data['offset'] = True ]] (introduced in https://gerrit.wikimedia.org/r/#/c/234851/)
which sets offset = True on line 6106 thus passing offset: True to the mediawiki api when the continue brings the proces back to line 6072.