Bugs item #1933132, was opened at 2008-04-03 05:13
Message generated for change (Comment added) made by uberfuzzy
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1933132&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Paul Tap (paultap)
Assigned to: Nobody/Anonymous (nobody)
Summary: pagefromfile.py fails with error in wikipedia.py
Initial Comment:
I'm trying to append a bit of text to an existing file (actually wanted to create a new one), but the script pagefromfile.py fails with the following output:
python pagefromfile.py -appendbottom -file:/tmp/Testpage.xml
Checked for running processes. 1 processes currently running, including the current process.
Pywikipediabot (r5177 (wikipedia.py), Apr 02 2008, 14:48:54)
Python 2.5.2 (r252:60911, Mar 12 2008, 13:36:25)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)]
>>> Hond <<<
Getting page [[Hond]]
Page Hond already exists, appending on bottom!
Getting information for site PaulIen:en
Password for user Filebot on PaulIen:en:
Logging in to PaulIen:en as Filebot
Should be logged in now
Getting information for site PaulIen:en
Traceback (most recent call last):
File "pagefromfile.py", line 296, in <module>
main()
File "pagefromfile.py", line 292, in main
bot.run()
File "pagefromfile.py", line 124, in run
self.put(title, contents)
File "pagefromfile.py", line 174, in put
page.put(contents, comment = comment, minorEdit = self.minor)
File "/home/paul/bin/PaulIen/pywikipedia/wikipedia.py", line 1174, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = False)
File "/home/paul/bin/PaulIen/pywikipedia/wikipedia.py", line 1098, in _getActionUser
if not self.site().isAllowed(action, sysop):
File "/home/paul/bin/PaulIen/pywikipedia/wikipedia.py", line 3897, in isAllowed
return right in self._rights[index]
TypeError: argument of type 'NoneType' is not iterable
When running in debug mode, this error does not occur, but the script complains about missing start/end tags (looks like another problem to me though).
I've tested upload.py with an image file and that works fine. Just to isolate the problem and to make sure that the filebot is working somehow.
Additional info (from the version page):
* MediaWiki: 1.11.1
* PHP: 5.2.5 (apache2handler)
* MySQL: 5.0.51a
pywikipedia svn update: Updated to revision 5177.
Regards,
Paul Tap
----------------------------------------------------------------------
Comment By: Uberfuzzy (uberfuzzy)
Date: 2008-04-03 06:01
Message:
Logged In: YES
user_id=1976885
Originator: NO
per change in wikipedia.py in #5173, wikipage detection was changed, but
misza missed a space.
on line 4192 (if different, just find "# Not a wiki page")
if '<body class="mediawiki' not in text:
change to
if '<body class="mediawiki' not in text:
note the 2 spaces between body and class, thats it
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1933132&group_…
Bugs item #1933132, was opened at 2008-04-03 11:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1933132&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Paul Tap (paultap)
Assigned to: Nobody/Anonymous (nobody)
Summary: pagefromfile.py fails with error in wikipedia.py
Initial Comment:
I'm trying to append a bit of text to an existing file (actually wanted to create a new one), but the script pagefromfile.py fails with the following output:
python pagefromfile.py -appendbottom -file:/tmp/Testpage.xml
Checked for running processes. 1 processes currently running, including the current process.
Pywikipediabot (r5177 (wikipedia.py), Apr 02 2008, 14:48:54)
Python 2.5.2 (r252:60911, Mar 12 2008, 13:36:25)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)]
>>> Hond <<<
Getting page [[Hond]]
Page Hond already exists, appending on bottom!
Getting information for site PaulIen:en
Password for user Filebot on PaulIen:en:
Logging in to PaulIen:en as Filebot
Should be logged in now
Getting information for site PaulIen:en
Traceback (most recent call last):
File "pagefromfile.py", line 296, in <module>
main()
File "pagefromfile.py", line 292, in main
bot.run()
File "pagefromfile.py", line 124, in run
self.put(title, contents)
File "pagefromfile.py", line 174, in put
page.put(contents, comment = comment, minorEdit = self.minor)
File "/home/paul/bin/PaulIen/pywikipedia/wikipedia.py", line 1174, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = False)
File "/home/paul/bin/PaulIen/pywikipedia/wikipedia.py", line 1098, in _getActionUser
if not self.site().isAllowed(action, sysop):
File "/home/paul/bin/PaulIen/pywikipedia/wikipedia.py", line 3897, in isAllowed
return right in self._rights[index]
TypeError: argument of type 'NoneType' is not iterable
When running in debug mode, this error does not occur, but the script complains about missing start/end tags (looks like another problem to me though).
I've tested upload.py with an image file and that works fine. Just to isolate the problem and to make sure that the filebot is working somehow.
Additional info (from the version page):
* MediaWiki: 1.11.1
* PHP: 5.2.5 (apache2handler)
* MySQL: 5.0.51a
pywikipedia svn update: Updated to revision 5177.
Regards,
Paul Tap
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1933132&group_…
Bugs item #1932907, was opened at 2008-04-03 07:16
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1932907&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mikko Silvonen (silvonen)
Assigned to: Nobody/Anonymous (nobody)
Summary: sre_constants.error in wikipedia.py called from interwiki.py
Initial Comment:
I got this error when running interwiki.py r5177 in autonomous mode. I use Python 2.5.
======Post-processing [[fi:Yorkshirenterrieri]]======
Updating links on page [[lt:Jorkšyro terjeras]].
Changes to be made: Pridedama: [[ko:??????]]
+ [[ko:??????]]
NOTE: Performing a recursive query first to save time....
NOTE: Nothing left to do 2
NOTE: Updating live wiki...
Sleeping for 26.7 seconds, 2008-04-03 06:57:31
Changing page [[lt:Jorkšyro terjeras]]
Dump fi (wikipedia) saved
Traceback (most recent call last):
File "C:\svn\pywikipedia\interwiki.py", line 1645, in <module>
bot.run()
File "C:\svn\pywikipedia\interwiki.py", line 1409, in run
self.queryStep()
File "C:\svn\pywikipedia\interwiki.py", line 1388, in queryStep
subj.finish(self)
File "C:\svn\pywikipedia\interwiki.py", line 976, in finish
if self.replaceLinks(page, new, bot):
File "C:\svn\pywikipedia\interwiki.py", line 1127, in replaceLinks
status, reason, data = page.put(newtext, comment = wikipedia.translate(page.site().lang, msg)[0] + mods)
File "C:\svn\pywikipedia\wikipedia.py", line 1210, in put
return self._putPage(newtext, comment, watchArticle, minorEdit, newPage, self.site().getToken(sysop = sysop), sysop = sysop)
File "C:\svn\pywikipedia\wikipedia.py", line 1366, in _putPage
).replace("$1", "(?P<length>[\d,. ]+)").replace("$2", "(?P<limit>[\d,. ]+)")
File "C:\Python25\lib\re.py", line 180, in compile
return _compile(pattern, flags)
File "C:\Python25\lib\re.py", line 233, in _compile
raise error, v # invalid expression
sre_constants.error: redefinition of group name u'length' as group 2; was group 1
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1932907&group_…
Revision: 5177
Author: cosoleto
Date: 2008-04-02 14:48:54 +0000 (Wed, 02 Apr 2008)
Log Message:
-----------
* Detect MediaWiki Long Page Error.
* Added un notify_unflagged_bot variable (default: true) to disable the warning (it appears repetitively also when getting pages)
Modified Paths:
--------------
trunk/pywikipedia/config.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2008-04-02 14:01:26 UTC (rev 5176)
+++ trunk/pywikipedia/config.py 2008-04-02 14:48:54 UTC (rev 5177)
@@ -45,8 +45,8 @@
disambiguation_comment = {}
gdab_namespaces = {}
-# Solve captchas in the webbrowser. Setting this to False will result in the
-# exception CaptchaError be thrown if a captcha is encountered.
+# Solve captchas in the webbrowser. Setting this to False will result in the
+# exception CaptchaError be thrown if a captcha is encountered.
solve_captcha = True
# Some sites will require password identication to access the HTML pages at
@@ -82,6 +82,9 @@
sysopnames[familyName] = {}
disambiguation_comment[familyName] = {}
+# Display a warning message if your edits appear in recent changes page
+notify_unflagged_bot = True
+
# Set to True to override the {{bots}} exclusion protocol (at your own risk!)
ignore_bot_templates = False
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-04-02 14:01:26 UTC (rev 5176)
+++ trunk/pywikipedia/wikipedia.py 2008-04-02 14:48:54 UTC (rev 5177)
@@ -25,6 +25,7 @@
PageNotSaved: Saving the page has failed
EditConflict: PageNotSaved due to edit conflict while uploading
SpamfilterError: PageNotSaved due to MediaWiki spam filter
+ LongPageError: PageNotSaved due to length limit
ServerError: Got unexpected response from wiki server
BadTitle: Server responded with BadTitle
UserBlocked: Client's username or IP has been blocked
@@ -183,6 +184,12 @@
self.url = arg
self.args = arg,
+class LongPageError(PageNotSaved):
+ """Saving the page has failed because it is too long."""
+ def __init__(self, arg, arg2):
+ self.length = arg
+ self.limit = arg2,
+
class ServerError(Error):
"""Got unexpected server response"""
@@ -1352,6 +1359,15 @@
if retry_delay > 30:
retry_delay = 30
continue
+ if self.site().has_mediawiki_message('longpageerror'):
+ long_page_errorR = re.compile(
+ html2unicode(
+ self.site().mediawiki_message('longpageerror')
+ ).replace("$1", "(?P<length>[\d,. ]+)").replace("$2", "(?P<limit>[\d,. ]+)")
+ )
+ match = long_page_errorR.search(data)
+ if match:
+ raise LongPageError(match.group('length'), match.group('limit'))
# We are expecting a 302 to the action=view page. I'm not sure why this was removed in r5019
if data.strip() != u"":
@@ -4235,7 +4251,7 @@
# Don't show warnings for not logged in users, they will just fail to
# do any action
if self._isLoggedIn[index]:
- if 'bot' not in self._rights[index]:
+ if 'bot' not in self._rights[index] and config.notify_unflagged_bot:
if sysop:
output(u'Note: Your sysop account on %s does not have a bot flag. Its edits will be visible in the recent changes.' % self)
else:
Bugs item #1839114, was opened at 2007-11-27 03:00
Message generated for change (Comment added) made by cosoleto
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1839114&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Windows Console don't echo messages
Initial Comment:
Hi. I'm updated the framework from CVS repo to SVN repo, but now I can't read nothing in the Windows Console. I', using Python 2.4, Window$ XP.
I send you a screenshot of my console with the "test.py" running, but it doesn't shows the text of the test.
Thanks for your answer.
(Sorry for my stupid english, I'm a Spanish speaker :( )
----------------------------------------------------------------------
>Comment By: Francesco Cosoleto (cosoleto)
Date: 2008-04-02 16:05
Message:
Logged In: YES
user_id=181280
Originator: NO
Fixed in r5176.
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto)
Date: 2008-01-21 14:18
Message:
Logged In: YES
user_id=181280
Originator: NO
Well... There is a problem with Windows and Python 2.4, the bot seems that
print the text in black, but the default foreground color is white. Until
the problem isn't fixed, you can install Python 2.5 or disable colorized
output by adding in user-config.py file: "colorized_output = False".
----------------------------------------------------------------------
Comment By: Mikko Silvonen (silvonen)
Date: 2008-01-20 17:41
Message:
Logged In: YES
user_id=127947
Originator: NO
I have the same problem on my Finnish Windows XP with the latest sources
(and Python 2.4). Is there a workaround?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1839114&group_…
Revision: 5176
Author: cosoleto
Date: 2008-04-02 14:01:26 +0000 (Wed, 02 Apr 2008)
Log Message:
-----------
Fixed bug #1839114 (''Windows Console don't echo messages'') related to Python 2.4, Windows, and a typo in the code.
Modified Paths:
--------------
trunk/pywikipedia/userinterfaces/terminal_interface.py
Modified: trunk/pywikipedia/userinterfaces/terminal_interface.py
===================================================================
--- trunk/pywikipedia/userinterfaces/terminal_interface.py 2008-04-02 13:06:55 UTC (rev 5175)
+++ trunk/pywikipedia/userinterfaces/terminal_interface.py 2008-04-02 14:01:26 UTC (rev 5176)
@@ -158,7 +158,7 @@
# ctypes is only available since Python 2.5, and we won't
# try to colorize without it. Instead we add *** after the text as a whole
# if anything needed to be colorized.
- lines = '\n'.split(text)
+ lines = text.split('\n')
for line in lines:
line, count = colorTagR.subn('', line)
if count > 0:
Revision: 5175
Author: russblau
Date: 2008-04-02 13:06:55 +0000 (Wed, 02 Apr 2008)
Log Message:
-----------
allow using -offset with -moves
Modified Paths:
--------------
trunk/pywikipedia/redirect.py
Modified: trunk/pywikipedia/redirect.py
===================================================================
--- trunk/pywikipedia/redirect.py 2008-04-01 20:06:31 UTC (rev 5174)
+++ trunk/pywikipedia/redirect.py 2008-04-02 13:06:55 UTC (rev 5175)
@@ -23,7 +23,7 @@
-namespace:n Namespace to process. Works only with an XML dump.
-offset:n Number of redirect to restart with (see progress). Works only
- with an XML dump.
+ with an XML dump or with -moves.
-moves Instead of using Special:Doubleredirects, use the page move
log to find double-redirect candidates (only works with
@@ -255,9 +255,9 @@
def get_moved_pages_redirects(self):
'''generate redirects to recently-moved pages'''
- offset=0
+ offset = max(0, self.offset)
site = wikipedia.getSite()
- while offset <= 10000: # Can't access more than 10000 log entries
+ while offset <= 10000: # MW won't accept offset value > 10000
move_url = \
"/w/index.php?title=Special:Log&limit=500&offset=%i&type=move"\
% offset
Revision: 5173
Author: misza13
Date: 2008-04-01 17:49:40 +0000 (Tue, 01 Apr 2008)
Log Message:
-----------
A more general "detection of wiki page" that should work under different skins
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-04-01 15:01:05 UTC (rev 5172)
+++ trunk/pywikipedia/wikipedia.py 2008-04-01 17:49:40 UTC (rev 5173)
@@ -4173,7 +4173,7 @@
* text - the page text
* sysop - is the user a sysop?
"""
- if '<div id="globalWrapper">' not in text:
+ if '<body class="mediawiki' not in text:
# Not a wiki page
return