jenkins-bot has submitted this change and it was merged.

Change subject: allpages.py: fix namespace param type
......................................................................


allpages.py: fix namespace param type

If namespace is a Namespace object, str(namespace) returns the name of
the namespace and not the index.
In the API query, the param will not be recognised as valid.

Bug: 73214
Change-Id: Ib69522bf8fc62cdd8815f45bfa7e9fb5c88f864e
---
M pywikibot/site.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/site.py b/pywikibot/site.py
index 7f3e1ea..1d40648 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3079,7 +3079,7 @@
                 filterredir = False
 
         apgen = self._generator(api.PageGenerator, type_arg="allpages",
-                                gapnamespace=str(namespace),
+                                gapnamespace=int(namespace),
                                 gapfrom=start, step=step, total=total,
                                 g_content=content)
         if prefix:
@@ -3138,7 +3138,7 @@
         if not isinstance(namespace, (int, Namespace)):
             raise Error("alllinks: only one namespace permitted.")
         algen = self._generator(api.ListGenerator, type_arg="alllinks",
-                                alnamespace=str(namespace), alfrom=start,
+                                alnamespace=int(namespace), alfrom=start,
                                 step=step, total=total)
         if prefix:
             algen.request["alprefix"] = prefix

-- 
To view, visit https://gerrit.wikimedia.org/r/173465
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib69522bf8fc62cdd8815f45bfa7e9fb5c88f864e
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to