Kolega2357 added a comment.
python category_redirect.py -family:wikipedia -lang:vi -pt:0
python category_redirect.py -family:wikipedia -lang:sh -pt:0
I use this command on two projects and command work several times, happens crash.
TASK DETAIL
https://phabricator.wikimedia.org/T94354
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Ladsgroup, Kolega2357
Cc: pywikipedia-bugs, Aklapper, Kolega2357, Anshoe
Aklapper added a comment.
Please describe steps to reproduce the problem.
Also, please paste text as text instead of images so it can be found by searching engines which search for text. Thanks!
TASK DETAIL
https://phabricator.wikimedia.org/T94354
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Ladsgroup, Aklapper
Cc: pywikipedia-bugs, Aklapper, Kolega2357, Anshoe
Xqt created this task.
Xqt added a subscriber: Xqt.
Xqt added a project: pywikibot-core.
Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION
One of the recent changes lead to following error:
```
C:\pwb\core>pwb.py redirect double -moves -total:600 -always -lang:war
Traceback (most recent call last):
File "C:\pwb\core\pwb.py", line 159, in <module>
import pywikibot # noqa
File "C:\pwb\core\pywikibot\__init__.py", line 38, in <module>
from pywikibot.exceptions import (
File "C:\pwb\core\pywikibot\exceptions.py", line 485, in <module>
import pywikibot.data.api
ImportError: No module named data.api
^CBatchvorgang abbrechen (J/N)?
```
TASK DETAIL
https://phabricator.wikimedia.org/T94348
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt
Cc: pywikipedia-bugs, Xqt, Aklapper, jayvdb
XZise added a comment.
That seems sensible. Allow the Site to be a Page as it also stores a Site. If it's a page it could be page relative and otherwise it's always absolute.
TASK DETAIL
https://phabricator.wikimedia.org/T57113
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: happy5214, XZise
Cc: XZise, valhallasw, gerritbot, happy5214, Legoktm, jayvdb, Ladsgroup, pywikipedia-bugs
valhallasw added a comment.
Doh. You're right. That means we have to pass through a Link object, then? I.e. the method would then be
targetpage = Page(Link('/b', oldpage))
which currently doesn't work, as Link requires a Site object (?!):
>>> pywikibot.Link("/b", p)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/valhallasw/src/pywikibot-core/pywikibot/page.py", line 4369, in __init__
"source parameter should be a Site object"
AssertionError: source parameter should be a Site object
TASK DETAIL
https://phabricator.wikimedia.org/T57113
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: happy5214, valhallasw
Cc: XZise, valhallasw, gerritbot, happy5214, Legoktm, jayvdb, Ladsgroup, pywikipedia-bugs
XZise added a comment.
Unfortunately yes, copied from the documentation:
If the first argument is a Page, create a copy of that object.
This can be used to convert an existing Page into a subclass
object, such as Category or FilePage. (If the title is also
given as the second argument, creates a copy with that title;
this is used when pages are moved.)
TASK DETAIL
https://phabricator.wikimedia.org/T57113
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: happy5214, XZise
Cc: XZise, valhallasw, gerritbot, happy5214, Legoktm, jayvdb, Ladsgroup, pywikipedia-bugs
valhallasw added a comment.
I think the correct interpretation of Page(page, title) is 'the page a Link with /title/ links to from Page /page/'. Is there another interpretation that also makes sense? Why would you pass a Page object if it's not where you found the link?
TASK DETAIL
https://phabricator.wikimedia.org/T57113
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: happy5214, valhallasw
Cc: XZise, valhallasw, gerritbot, happy5214, Legoktm, jayvdb, Ladsgroup, pywikipedia-bugs
XZise added subscribers: valhallasw, XZise.
XZise added a comment.
@valhallasw: I'm not sure it's that simple. The current implementation has already a meaning for `Page(page, title)` and title could be “/foo” and then is the question is it's a subpage or not? Afaik it's only a subpage when it's a link on a page (I'm not sure if the namespace has to be a subpages namespace).
TASK DETAIL
https://phabricator.wikimedia.org/T57113
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: happy5214, XZise
Cc: XZise, valhallasw, gerritbot, happy5214, Legoktm, jayvdb, Ladsgroup, pywikipedia-bugs