Bugs item #1810765, was opened at 2007-10-10 08:20
Message generated for change (Settings changed) made by leogregianin
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1810765&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: shizhao (wikishizhao)
Assigned to: Nobody/Anonymous (nobody)
Summary: removeImage() BUG
Initial Comment:
Traceback (most recent call last):
File "deledpimage.py", line 38, in ?
text.removeImage(article.title(), True, summary, True)
File "/home/.chanel/shizhao/pywikipediabot/wikipedia.py", line 1998, in removeImage
return self.replaceImage(image, None, put, summary, safe)
File "/home/.chanel/shizhao/pywikipediabot/wikipedia.py", line 2075, in replaceImage
templateR = re.compile(ur'(?s)\{\{(?<contents>.*?\}\}')
File "/usr/lib/python2.3/sre.py", line 179, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.3/sre.py", line 230, in _compile
raise error, v # invalid expression
sre_constants.error: syntax error
deledpimage.py see http://zh.wikipedia.org/wiki/User:Sz-iwbot/deledpimage.py
----------------------------------------------------------------------
Comment By: stanlekub (stanlekub)
Date: 2007-10-10 08:31
Message:
Logged In: YES
user_id=1670659
Originator: NO
Seems to me that the regex should be replaced by
templateR = re.compile(ur'(?s)\{\{(?P<contents>.*?\}\}')
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1810765&group_…
Bugs item #1821360, was opened at 2007-10-27 16:50
Message generated for change (Settings changed) made by leogregianin
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1821360&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: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: André Malafaya Baptista (malafaya)
Assigned to: Nobody/Anonymous (nobody)
Summary: cosmetic_changes.py crashes
Initial Comment:
Trace below should be self-explanatory:
>cosmetic_changes.py -lang:pt Portugal
Checked for running processes. 2 processes currently running, including the current process.
ATTENTION: You can run this script as a stand-alone for testing purposes.
However, the changes are that are made are only minor, and other users
might get angry if you fill the version histories and watchlists with such
irrelevant changes.
Do you really want to continue? ([y]es, [N]o) y
Getting 1 pages from wikipedia:pt...
>>> Portugal <<<
Traceback (most recent call last):
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 398,
in <module>
main()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 394,
in main
bot.run()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 359,
in run
self.treat(page)
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 340,
in treat
changedText = ccToolkit.change(page.get())
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 88, i
n change
text = self.cleanUpLinks(text)
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 259,
in cleanUpLinks
text = wikipedia.replaceExcept(text, linkR, handleOneLink, ['comment', 'math
', 'nowiki', 'pre', 'startspace'])
File "D:\Work\pywikipediabot-HEAD\pywikipedia\wikipedia.py", line 2813, in rep
laceExcept
new = new.replace('\\n', '\n')
AttributeError: 'function' object has no attribute 'replace'
----------------------------------------------------------------------
Comment By: Rotem Liss (rotemliss)
Date: 2007-11-15 07:19
Message:
Logged In: YES
user_id=1327030
Originator: NO
Fixed in r4547.
----------------------------------------------------------------------
Comment By: Rotem Liss (rotemliss)
Date: 2007-10-29 07:44
Message:
Logged In: YES
user_id=1327030
Originator: NO
The problem in wikipedia.py, in the function replaceExcept. "new" may be
either function or string (or unicode string), but in line 2813, the
replace method is called (if the OS is Win32), without knowing if it is a
function or a string. The code block in lines 2806-2813 should be moved
down, after the "except TypeError" part, where it is known for sure that
"new" is a string.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1821360&group_…
Bugs item #1830917, was opened at 2007-11-13 05:01
Message generated for change (Settings changed) made by leogregianin
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1830917&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: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Redirect.py cannot handle meta links and crashes
Initial Comment:
When doing a "redirect.py double -xml:XX -always" on the French wikipedia :
Checking redirect 13106 of 385262...
>>> Utilisateur:Céréales Killer/Parser <<<
Target link 'm:ParserFunctions/fr' has different family 'm'
Exception in Page constructor
site=wikipedia:fr, title=m:ParserFunctions/fr, insite=wikipedia:fr, defaultNamespace=0
Traceback (most recent call last):
File "redirect.py", line 333, in <module>
main()
File "redirect.py", line 330, in main
bot.run()
File "redirect.py", line 285, in run
self.fix_double_redirects()
File "redirect.py", line 261, in fix_double_redirects
secondTargetPage = secondRedir.getRedirectTarget()
File "/home/nico/projets/pywikipedia/wikipedia.py", line 1580, in getRedirectTarget
return Page(self.site(), arg[0])
File "/home/nico/projets/pywikipedia/wikipedia.py", line 380, in __init__
self._site = getSite(otherlang, familyName)
File "/home/nico/projets/pywikipedia/wikipedia.py", line 4930, in getSite
_sites[key] = Site(code=code, fam=fam, user=user, persistent_http=persistent_http)
File "/home/nico/projets/pywikipedia/wikipedia.py", line 3574, in __init__
raise KeyError("Language %s does not exist in family %s"%(self.lang,self.family.name))
KeyError: 'Language fr does not exist in family meta'
----------------------------------------------------------------------
Comment By: Russell Blau (russblau)
Date: 2007-11-14 19:54
Message:
Logged In: YES
user_id=855050
Originator: NO
Fixed in r4545.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1830917&group_…
Bugs item #1821360, was opened at 2007-10-27 22:50
Message generated for change (Comment added) made by rotemliss
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1821360&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: André Malafaya Baptista (malafaya)
Assigned to: Nobody/Anonymous (nobody)
Summary: cosmetic_changes.py crashes
Initial Comment:
Trace below should be self-explanatory:
>cosmetic_changes.py -lang:pt Portugal
Checked for running processes. 2 processes currently running, including the current process.
ATTENTION: You can run this script as a stand-alone for testing purposes.
However, the changes are that are made are only minor, and other users
might get angry if you fill the version histories and watchlists with such
irrelevant changes.
Do you really want to continue? ([y]es, [N]o) y
Getting 1 pages from wikipedia:pt...
>>> Portugal <<<
Traceback (most recent call last):
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 398,
in <module>
main()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 394,
in main
bot.run()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 359,
in run
self.treat(page)
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 340,
in treat
changedText = ccToolkit.change(page.get())
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 88, i
n change
text = self.cleanUpLinks(text)
File "D:\Work\pywikipediabot-HEAD\pywikipedia\cosmetic_changes.py", line 259,
in cleanUpLinks
text = wikipedia.replaceExcept(text, linkR, handleOneLink, ['comment', 'math
', 'nowiki', 'pre', 'startspace'])
File "D:\Work\pywikipediabot-HEAD\pywikipedia\wikipedia.py", line 2813, in rep
laceExcept
new = new.replace('\\n', '\n')
AttributeError: 'function' object has no attribute 'replace'
----------------------------------------------------------------------
Comment By: Rotem Liss (rotemliss)
Date: 2007-11-15 12:19
Message:
Logged In: YES
user_id=1327030
Originator: NO
Fixed in r4547.
----------------------------------------------------------------------
Comment By: Rotem Liss (rotemliss)
Date: 2007-10-29 13:44
Message:
Logged In: YES
user_id=1327030
Originator: NO
The problem in wikipedia.py, in the function replaceExcept. "new" may be
either function or string (or unicode string), but in line 2813, the
replace method is called (if the OS is Win32), without knowing if it is a
function or a string. The code block in lines 2806-2813 should be moved
down, after the "except TypeError" part, where it is known for sure that
"new" is a string.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1821360&group_…
Revision: 4547
Author: rotem
Date: 2007-11-15 10:18:54 +0000 (Thu, 15 Nov 2007)
Log Message:
-----------
Fixing a possible crash in wikipedia.replaceExcept on Windows: Don't use the replace method on a function object (see bug 1821360).
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2007-11-15 05:14:45 UTC (rev 4546)
+++ trunk/pywikipedia/wikipedia.py 2007-11-15 10:18:54 UTC (rev 4547)
@@ -2807,22 +2807,21 @@
index = nextExceptionMatch.end()
else:
# We found a valid match. Replace it.
-
- # This is a hack for Windows users. As they're unable to enter real
- # linebreaks in the command prompt, this line allows them to enter
- # backslash-n instead.
- # This means that it is impossible replace a string with a real
- # backslash-n sequence (it will always become a linebreak), but
- # it is unprobable that someone will want to do that.
- if sys.platform=='win32':
- new = new.replace('\\n', '\n')
-
try:
# the parameter new can be a function which takes the match as a parameter.
replacement = new(match)
except TypeError:
# it is not a function, but a string.
+ # This is a hack for Windows users. As they're unable to enter real
+ # linebreaks in the command prompt, this line allows them to enter
+ # backslash-n instead.
+ # This means that it is impossible replace a string with a real
+ # backslash-n sequence (it will always become a linebreak), but
+ # it is unprobable that someone will want to do that.
+ if sys.platform=='win32':
+ new = new.replace('\\n', '\n')
+
# We cannot just insert the new string, as it may contain regex
# group references such as \2 or \g<name>.
# On the other hand, this approach does not work because it can't
Bugs item #1831698, was opened at 2007-11-14 11:44
Message generated for change (Comment added) made by siebrand
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1831698&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: 8
Private: No
Submitted By: siebrand (siebrand)
Assigned to: Nobody/Anonymous (nobody)
Summary: Partial pages saved on connection reset
Initial Comment:
I have gotten 2 reports of CommonsDelinker saving incomplete pages: http://bg.wikipedia.org/w/index.php?title=19_%D0%BD%D0%BE%D0%B5%D0%BC%D0%B2… and http://ru.wikipedia.org/w/index.php?title=%D0%93%D0%BB%D0%B0%D0%B7%D0%B3%D0…
Discussing this on IRC it was thought to originate from a connection reset. My question was why the wiki would save a page that was not sent completely. This appears to have to do with sending an 'edit token' before the edit data. If possible, this should be reversed so these mistakes cannot happen (worst case is the edit is not made).
IRC chat (freenode #pywikipediabot):
[11:57] <siebrand> Bryan: big "oops": <URL at ru.wp>
[11:58] <valhallasw> siebrand: looks like some connection reset
[..]
[11:58] <Bryan> what valhallasw said
[..]
[11:58] <Bryan> maybe we should change wikipedia.py such that it sends wpEditToken as last item
[11:59] <Bryan> so stuff like this doesn't happen
[11:59] <siebrand> Connection reset sounds logical, although, why would MediaWiki accept that?
[11:59] <valhallasw> because connection closed is connection closed
[11:59] <siebrand> ah, I see bryan explained that :)
[12:00] <valhallasw> Bryan: sounds like a good idea in any case :)
[12:00] <siebrand> indeed the bot needs to signal in some way that it is actually "done submitting" before the wiki accepts its changes. If that is the "edit token", then it may be a good idea to send that as the last item.
[12:00] <valhallasw> well, mediawiki won't accept an edit without edit token
[12:00] <valhallasw> and it has no way to check if the complete request has been sent
[12:00] <valhallasw> so the only way to prevent saving is sending some required header last
[12:01] <valhallasw> Bryan: are we not using some content-length header? that should fix the problem, too
[12:01] <Bryan> no idea
----------------------------------------------------------------------
>Comment By: siebrand (siebrand)
Date: 2007-11-15 10:50
Message:
Logged In: YES
user_id=1107255
Originator: YES
A very recent one:
http://it.wikipedia.org/w/index.php?title=Discussione:Socialdemocrazia&diff…
----------------------------------------------------------------------
Comment By: siebrand (siebrand)
Date: 2007-11-15 08:51
Message:
Logged In: YES
user_id=1107255
Originator: YES
Additional report:
http://fr.wikipedia.org/w/index.php?title=Guerre_de_Cent_Ans&diff=22942716&…
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1831698&group_…
Bugs item #1831698, was opened at 2007-11-14 11:44
Message generated for change (Comment added) made by siebrand
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1831698&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: 8
Private: No
Submitted By: siebrand (siebrand)
Assigned to: Nobody/Anonymous (nobody)
Summary: Partial pages saved on connection reset
Initial Comment:
I have gotten 2 reports of CommonsDelinker saving incomplete pages: http://bg.wikipedia.org/w/index.php?title=19_%D0%BD%D0%BE%D0%B5%D0%BC%D0%B2… and http://ru.wikipedia.org/w/index.php?title=%D0%93%D0%BB%D0%B0%D0%B7%D0%B3%D0…
Discussing this on IRC it was thought to originate from a connection reset. My question was why the wiki would save a page that was not sent completely. This appears to have to do with sending an 'edit token' before the edit data. If possible, this should be reversed so these mistakes cannot happen (worst case is the edit is not made).
IRC chat (freenode #pywikipediabot):
[11:57] <siebrand> Bryan: big "oops": <URL at ru.wp>
[11:58] <valhallasw> siebrand: looks like some connection reset
[..]
[11:58] <Bryan> what valhallasw said
[..]
[11:58] <Bryan> maybe we should change wikipedia.py such that it sends wpEditToken as last item
[11:59] <Bryan> so stuff like this doesn't happen
[11:59] <siebrand> Connection reset sounds logical, although, why would MediaWiki accept that?
[11:59] <valhallasw> because connection closed is connection closed
[11:59] <siebrand> ah, I see bryan explained that :)
[12:00] <valhallasw> Bryan: sounds like a good idea in any case :)
[12:00] <siebrand> indeed the bot needs to signal in some way that it is actually "done submitting" before the wiki accepts its changes. If that is the "edit token", then it may be a good idea to send that as the last item.
[12:00] <valhallasw> well, mediawiki won't accept an edit without edit token
[12:00] <valhallasw> and it has no way to check if the complete request has been sent
[12:00] <valhallasw> so the only way to prevent saving is sending some required header last
[12:01] <valhallasw> Bryan: are we not using some content-length header? that should fix the problem, too
[12:01] <Bryan> no idea
----------------------------------------------------------------------
>Comment By: siebrand (siebrand)
Date: 2007-11-15 08:51
Message:
Logged In: YES
user_id=1107255
Originator: YES
Additional report:
http://fr.wikipedia.org/w/index.php?title=Guerre_de_Cent_Ans&diff=22942716&…
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1831698&group_…