Last modified: 2013-12-24 18:30:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57223, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55223 - archivebot.py not working on dewikinews
archivebot.py not working on dewikinews
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:46 UTC by Kunal Mehta (Legoktm)
Modified: 2013-12-24 18:30 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:46:10 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1391/
Reported by: Anonymous user
Created on: 2012-01-09 19:13:59
Subject: archivebot.py not working on dewikinews
Original description:
As the title says, archivebot.py is not working on dewikinews, without an error message. Using verbose output \(adding import wikipedia; wikipedia.verbose = 1\) you can see that it doesn't even try to change pages, although there are changes that need to be done \(I've added that as attachment, the output goes on like the last two for all pages out of http://de.wikinews.org/wiki/Spezial:Linkliste/Vorlage:Autoarchiv and exits then\). The script is running on the toolserver,
version.py:
hoo@willow:~/pywikipedia$ python version.py
Pywikipedia \[http\] trunk/pywikipedia \(r9822, 2012/01/04, 08:38:45\)
Python 2.7.1 \(r271:86832, Jan  4 2011, 13:57:14\)
\[GCC 4.5.2\]
config-settings:
use\_api = True
use\_api\_login = True
unicode test: ok
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:46:12 UTC
Dump of the verbose output of archivebot.py
Comment 2 Kunal Mehta (Legoktm) 2013-10-05 04:46:14 UTC
Had it previously worked? If so, when did stop? What is the bot name that archives?
Comment 3 Kunal Mehta (Legoktm) 2013-10-05 04:46:16 UTC
I guess from the German keywords in http://de.wikinews.org/wiki/Vorlage:Autoarchiv that are not part of the framework, you may use an individual code. If so, please try to rewrite the template keywords to original English parameters on some talk pages, and run the official distribution to see if it works. Individually modified scripts are not in the scope of Pywiki team.
Comment 4 Kunal Mehta (Legoktm) 2013-10-05 04:46:17 UTC
Yes, it used to work, see https://de.wikinews.org/wiki/Spezial:Beitr%C3%A4ge/Archiver

They only switched the layout after I gave with pywp \(https://de.wikinews.org/w/index.php?diff=617692&oldid=403682\)
Comment 5 Kunal Mehta (Legoktm) 2013-10-05 04:46:19 UTC
Its due to an issue with the timestamp that is used on their wiki. I am not sure if this will work 100% but here is the patch:

Index: archivebot.py
===================================================================
\--- archivebot.py	\(revision 9923\)
+++ archivebot.py	\(working copy\)
@@ -233,6 +233,8 @@
if not TM:
TM = re.search\(r'\(\d\d?\)\\. \(\S+\) \(\d\d\d\d\) kello \W\*\(\d\d\).\(\d\d\) \\\(.\*?\\\)', line\)
if not TM:
\+            TM = re.search\(r'\(\d\d\):\(\d\d\), \(\d\d?\)\\. \(\S+\)\\.? \(\d\d\d\d\) \\\(.\*?\\\)', line\)
\+        if not TM:
\# 14:23, 12. Jan. 2009 \(UTC\)
pat = re.compile\(r'\(\d\d\):\(\d\d\), \(\d\d?\)\\. \(\S+\)\\.? \(\d\d\d\d\) \\\(UTC\\\)'\)
TM = pat.search\(line\)
@@ -240,6 +242,8 @@
\#            pywikibot.output\(TM\)
TIME = txt2timestamp\(TM.group\(0\),"%d. %b %Y kl. %H:%M \(%Z\)"\)
if not TIME:
\+                TIME = txt2timestamp\(TM.group\(0\),"%H:%M, %d. %b. %Y \(CEST\)"\)
\+            if not TIME:
TIME = txt2timestamp\(TM.group\(0\), "%Y. %B %d., %H:%M \(%Z\)"\)
if not TIME:
TIME = txt2timestamp\(TM.group\(0\),"%d. %b %Y kl.%H:%M \(%Z\)"\)
@@ -263,9 +267,9 @@
TIME = txt2timestamp\(TM.group\(0\),"%H:%M, %d. %b. %Y \(%Z\)"\)
if TIME:
self.timestamp = max\(self.timestamp,time.mktime\(TIME\)\)
-\#                pywikibot.output\(u'Time to be parsed: %s' % TM.group\(0\)\)
-\#                pywikibot.output\(u'Parsed time: %s' % TIME\)
-\#                pywikibot.output\(u'Newest timestamp in thread: %s' % TIME\)
\+            \# pywikibot.output\(u'Time to be parsed: %s' % TM.group\(0\)\)
\+            \# pywikibot.output\(u'Parsed time: %s' % TIME\)
\+            \# pywikibot.output\(u'Newest timestamp in thread: %s' % TIME\)

def size\(self\):
return len\(self.title\) + len\(self.content\) + 12
Comment 6 Kunal Mehta (Legoktm) 2013-10-05 04:46:21 UTC
Has the timestamp format changed? That would be a primary information. When, how?
In the first run, Der\_Hausgeist and Giftpflanze  should be asked \(or are you any of them?\)
Anyhow, as the official version of archivebot.py does not contain German keywords, and the i18n file contains only German edit summaries, not localized parameters, this must be an individual script. Please try to run the official distribution with Englis keywords and report if it works.
Comment 7 Merlijn van Deen (test) 2013-12-24 18:30:26 UTC
I think this should be fixed by Iede5165fd36b8e5747db032183094fa11177b037

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links