Bugs item #3021792, was opened at 2010-06-26 10:36
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3021792&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: 6
Private: No
Submitted By: Anypodetos (anypodetos)
Assigned to: xqt (xqt)
Summary: templatesWithParams() misses templates
Initial Comment:
wikipedia.templatesWithParams() does not find templates if they contain curly braces. For example, {{drugbox}} on en.wikipedia.org/wiki/Semagacestat is not found, but after removing the "{" in the parameter IUPAC_name (which I tried in my sandbox), everything works fine.
output of version.py:
Pywikipedia [http] trunk/pywikipedia (r8334, 2010/06/25, 17:45:36)
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-04-04 00:22
Message:
I guess it is easier to replace "{" inside the parameter field with the
corresponding hmtl tag
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3021792&group_…
Bugs item #3021792, was opened at 2010-06-26 10:36
Message generated for change (Settings changed) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3021792&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: 6
Private: No
Submitted By: Anypodetos (anypodetos)
>Assigned to: xqt (xqt)
Summary: templatesWithParams() misses templates
Initial Comment:
wikipedia.templatesWithParams() does not find templates if they contain curly braces. For example, {{drugbox}} on en.wikipedia.org/wiki/Semagacestat is not found, but after removing the "{" in the parameter IUPAC_name (which I tried in my sandbox), everything works fine.
output of version.py:
Pywikipedia [http] trunk/pywikipedia (r8334, 2010/06/25, 17:45:36)
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3021792&group_…
Bugs item #3603953, was opened at 2013-02-09 10:55
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3603953&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: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: xqt (xqt)
Summary: catlib.py - sortkeyprefix exists since 1.17?
Initial Comment:
r11013 breaks categories with mw 1.16
KeyError: 'sortkeyprefix'
API: Unrecognized value for parameter 'cmprop': sortkeyprefix
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-04-03 23:31
Message:
fixed in r11334
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3603953&group_…
Bugs item #3603953, was opened at 2013-02-09 10:55
Message generated for change (Settings changed) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3603953&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: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: catlib.py - sortkeyprefix exists since 1.17?
Initial Comment:
r11013 breaks categories with mw 1.16
KeyError: 'sortkeyprefix'
API: Unrecognized value for parameter 'cmprop': sortkeyprefix
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3603953&group_…
Bugs item #3158761, was opened at 2011-01-15 01:17
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3158761&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: Duplicate
Priority: 5
Private: No
Submitted By: Bináris (binbot)
Assigned to: xqt (xqt)
Summary: Template exception overworks in replace.py
Initial Comment:
I correct spelling mistakes with replace.py, and use exception:
'exceptions': {
'inside-tags': [
'hyperlink',
'template',
],
etc. as shown at http://meta.wikimedia.org/wiki/Pywikipediabot/replace.py/it
This exception excludes a lot of text that should be replaced! After a long investigation I suspect that the problem may exist when the template is complicated, e. g. the article begins with an infobox. The bot probably thinks to be inside of the template when it is already closed.
Examples:
In the last sentence of section http://hu.wikipedia.org/w/index.php?title=Nagyv%C3%A1rad&oldid=9085449#N.C3… the word "telepitettek" was not found. The article begins with an infobox.
In the middle of section http://hu.wikipedia.org/w/index.php?title=Opera_%28sz%C3%ADnm%C5%B1%29&oldi… the word "Szenitávnéji" was not found. The article has no infobox, but the text is preceeded by some templates with parameters, one of them at the very beginning.
In section http://hu.wikipedia.org/w/index.php?title=Tennessee&oldid=9028125#Megy.C3.A… the word "alapitási" was not found. The article begins with an infobox.
But:
The bot made the replacement here: http://hu.wikipedia.org/w/index.php?title=Mozilla&diff=9106942&oldid=8920815
This is also preceeded by some templates, which have parameters, but the one at the beginning of the article has no parameters. Does this make the difference?
All the above mentioned instances were found by the bot when I commented the word "template" out of the exceptions.
Not clear whether the bug is in replace.py or pagegenerators.
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-04-03 22:57
Message:
fixed with r11333
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2011-05-12 14:24
Message:
duplicate to bug #2819291
----------------------------------------------------------------------
Comment By: Bináris (binbot)
Date: 2011-02-09 01:38
Message:
At least a comment, thank you for dealing with the problem.
What I know, in the present form it definitely works wrongly.
----------------------------------------------------------------------
Comment By: Merlijn S. van Deen (valhallasw)
Date: 2011-02-08 23:56
Message:
Well... this is why we desperately need unit tests. In a quick response -
I'm afraid the suggested fix' will break detection of nested templates. Or
rather, a template like
{{ blah | {{ yakk }} | more stuff }} will not be detected as a nested
template, but as {{ blah | {{ yakk }}.
Not a 100% sure on this, but this should be tested before applying the
suggested fix.
----------------------------------------------------------------------
Comment By: Bináris (binbot)
Date: 2011-02-08 19:16
Message:
Would anyone please correct this bug? One character only. TIA
----------------------------------------------------------------------
Comment By: Bináris (binbot)
Date: 2011-01-15 14:36
Message:
Hurray, I have caught it! The bugfix is easy. In pywikibot/textlib.py, line
83, the outer brace is greedy. Changing
'template': re.compile(r'(?s){{(({{.*?}})|.)*}}'),
to
'template': re.compile(r'(?s){{(({{.*?}})|.)*?}}'),
solved the problem for me.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3158761&group_…
Bugs item #3603994, was opened at 2013-02-10 02:14
Message generated for change (Settings changed) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3603994&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: None
Priority: 6
Private: No
Submitted By: Davide Bolsi (basilicofresco)
>Assigned to: xqt (xqt)
Summary: replace.py stucks: template exclusion is broken
Initial Comment:
The "template" exclusion in "replaceExcept" stucks the script when used on a page that contains not closed template brackets: {{... eof.
For example this line
text = pywikibot.replaceExcept(text, u" +", ur" ", ['template'])
used on this page
http://commons.wikimedia.org/w/index.php?title=User:Basilicofresco/test2&ol…
halts indefinitely the execution script.
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-04-03 22:56
Message:
should be fixed with r11333
----------------------------------------------------------------------
Comment By: Davide Bolsi (basilicofresco)
Date: 2013-03-16 00:09
Message:
For example this simple test replacement stucks indefinitely:
replace.py -page:"File:Serif and sans-serif 01.png" -lang:commons
-family:commons -exceptinsidetag:template "[" ""
This happens also with the dumpfile.
----------------------------------------------------------------------
Comment By: Davide Bolsi (basilicofresco)
Date: 2013-02-18 11:49
Message:
This is not a minor issue.
For example on the page "Middle Ages" on the english Wikipedia, the
replace.py script fails miserably because within the section "Crusades"
there is a "efn" template not closed.
http://en.wikipedia.org/w/index.php?title=Middle_Ages&oldid=538899472
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3603994&group_…
Bugs item #2819291, was opened at 2009-07-09 15:31
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2819291&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: None
Priority: 7
Private: No
Submitted By: NeuCeu (neuceu)
>Assigned to: xqt (xqt)
Summary: 'template' exception in wikipedia.replaceExcept() isn't good
Initial Comment:
Version:
Pywikipedia [http] trunk/pywikipedia (r7032, Jul 08 2009, 03:18:37)
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)]
Because of the 'template' exception, large part of a page text can be ignored.
How to reproduce : run replace.py on fr.wiki with page "Slayers" and exeption 'template'
python replace.py -exceptinsidetag:template -regex "([Aa])ncêtre" "\1ncêetre" -namespace:0 -page:"Slayers"
It should normally find something to replace.
Possible fix : If I remove (?s) in front of the 'template' regex, it works. IMHO I would replace the .* by [^}]*
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-04-03 22:54
Message:
fixed in r11333
----------------------------------------------------------------------
Comment By: Bináris (binbot)
Date: 2012-01-30 11:14
Message:
See also
http://lists.wikimedia.org/pipermail/pywikipedia-l/2012-January/thread.html…
([Pywikipedia-l] Template parsing code thread)
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2011-05-12 14:24
Message:
see also bug #3158761
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2819291&group_…
Bugs item #3579646, was opened at 2012-10-23 21:53
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3579646&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: AleXXw ()
>Assigned to: xqt (xqt)
Summary: Reading Templates within Templates
Initial Comment:
Hi!
Pywikipedia is used to harvest the in-wiki monument lists to the monuments database. I noticed the Error https://bugzilla.wikimedia.org/show_bug.cgi?id=39973, the following lines are a copy of the existing bug:
Some values provided by headertemplates (ie 'Gemeinde' in Austrian lists) are
not filled if there is a template part of any row parameter. Specific example:
http://de.wikipedia.org/wiki/Liste_der_denkmalgesch%C3%BCtzten_Objekte_in_P…
In article:
{{Denkmalliste Österreich Tabellenkopf
|Gemeinde = Pfons
|Bezirk = Bezirk Innsbruck Land
<...>
}}
{{Denkmalliste Österreich Tabellenzeile
|Name = Friedhof mit Kapellen und Kleindenkmalen
|Beschreibung =
|ObjektID = 110694
<...>
}}
{{Denkmalliste Österreich Tabellenzeile
|Name = Kath. Pfarrkirche Mariä Himmelfahrt
|Beschreibung = {{Hauptartikel|Mariä-Himmelfahrt-Kirche (Pfons)}}
|ObjektID = 64604
<...>
}}
and in database:
SELECT `objektid`, `name`, `gemeinde`, `bezirk` FROM
`p_erfgoed_p`.`monuments_at_(de)` WHERE `objektid` = 110694 or `objektid` =
64604;
| objektid | name | gemeinde | bezirk
| 110694 | Friedhof mit Kapellen<...> | Pfons | Bezirk Innsbruck Land
| 64604 | Kath. Pfarrkirche Mar<...> | |
many other examples can be found by SELECT * FROM
`p_erfgoed_p`.`monuments_at_(de)` WHERE `gemeinde` = '';
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-04-03 22:42
Message:
could you give me a pwb code snippet or a script command line to reproduce
this behaviour
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3579646&group_…
Bugs item #3609967, was opened at 2013-04-03 18:32
Message generated for change (Tracker Item Submitted) made by cdpark
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3609967&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: interwiki
Group: trunk
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: ChongDae (cdpark)
Assigned to: Nobody/Anonymous (nobody)
Summary: interwiki() fails for closed wikipedia
Initial Comment:
Page.interwiki() and PageData.interwiki() fails when wikidata contains sitelinks of closed wikipedias.
For example, following code is broken now.
---------------------------------------------------------------------------------------------------
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pywikibot
en = pywikibot.getSite('en', 'wikipedia')
mainpage = pywikibot.Page(en, u'Main Page')
interwiki = mainpage.interwiki()
print interwiki
--------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3609967&group_…
Bugs item #3609685, was opened at 2013-04-01 04:37
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3609685&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: Pending
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: leeyc0 (leeyc0)
Assigned to: xqt (xqt)
Summary: templatesWithParams parser bug
Initial Comment:
version.py info:
Pywikipedia [http] trunk/pywikipedia (r11308, 2013/03/30, 16:56:02, OUTDATED)
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
Below is the code snippet that demonstrates the bug:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia as pywikibot
site = pywikibot.getSite()
page = pywikibot.Page(site, "Template:001") # or some other page, the page itself is irrelevant here
pageText = u"{{monster | {{{1}}} | id=001}}"
print(page.templatesWithParams(pageText))
I found that the output is
[(u'1', [])]
instead of expected value
[(u'Monster', [u' {{{1}}}', u' id=001'])]
However, if I change pageText to
pageText = u"{{monster | abc | id=001}}"
Then the output would be
[(u'Monster', [u' abc ', u' id=001'])]
Which is correct.
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-04-03 09:56
Message:
fixed in r11324. Would you please check the new commit.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-04-03 09:28
Message:
reopened due to bug #3609794
I only chanced textlib.extract_templates_and_params() which worked good for
me. But Page.templatesWithParams() still fails
https://sourceforge.net/tracker/?func=detail&aid=3609794&group_id=93107&ati…
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-04-01 08:07
Message:
fixed in r11319, r11320
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3609685&group_…