diff --git a/pywikibot/site/_upload.py b/pywikibot/site/_upload.py index 0a0d0b6fb2..7cef645aed 100644 --- a/pywikibot/site/_upload.py +++ b/pywikibot/site/_upload.py @@ -173,7 +173,10 @@ def ignore_warnings(warnings): token = self.site.tokens['csrf'] result = None - file_page_title = self.filepage.title(with_ns=False) + file_page_title = self.filepage.title( + with_ns=False, + with_section=False, + ) file_size = None # make sure file actually exists