Bugs item #1804103, was opened at 2007-09-28 20:27
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=1804103&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: John Vandenberg (zeroj)
Assigned to: Nobody/Anonymous (nobody)
Summary: query.py not working
Initial Comment:
query.py appears to be out of sync with wikipeda.getUrl(). getUrl expects 'data' to be name=value pairs, however query.py is urlencoding the 'titles' data before calling it.
Also, the verbose output of "titlecount" is off by one
To see the problem, create a small test case using a sample invocation mentioned in query.py:
-- test.py --
import query
print query.GetInterwikies('ru',u'user:yurik')
-- error on execution---
Checked for running processes. 1 processes currently running, including the current process.
Traceback (most recent call last):
File "test.py", line 3, in ?
print query.GetInterwikies('ru',u'user:yurik')
File "/path/to/query.py", line 56, in GetInterwikies
return GetData( lang, params )
File "/path/to/query.py", line 40, in GetData
jsontext = site.getUrl( path, retry=True, data=data )
File "/path/to/wikipedia.py", line 3471, in getUrl
data = self.urlEncode(data)
File "/path/to/wikipedia.py", line 3279, in urlEncode
for key, value in query.iteritems():
AttributeError: 'str' object has no attribute 'iteritems'
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1804103&group_…
Bugs item #1804008, was opened at 2007-09-28 09:35
Message generated for change (Comment added) made by cosoleto
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1804008&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: 6
Private: No
Submitted By: Francesco Cosoleto (cosoleto)
Assigned to: Nobody/Anonymous (nobody)
Summary: showDiff() highlighting limitation due to difflib design
Initial Comment:
showDiff() can fail to highlight a char-by-char difference because Python difflib seems don't support fully char-by-char comparison.
Please see in Python tracker:
* issue #1528074: "difflib.SequenceMatcher.find_longest_match() wrong result" (http://bugs.python.org/issue1528074)
* issue #1678345: "A fix for the bug #1528074 [warning: quite slow]" (http://bugs.python.org/issue1678345)
----------------------------------------------------------------------
>Comment By: Francesco Cosoleto (cosoleto)
Date: 2007-09-28 09:38
Message:
Logged In: YES
user_id=181280
Originator: YES
File Added: difflib_test.py
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1804008&group_…
Bugs item #1804008, was opened at 2007-09-28 09:35
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=1804008&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: Francesco Cosoleto (cosoleto)
Assigned to: Nobody/Anonymous (nobody)
Summary: showDiff() highlighting limitation due to difflib design
Initial Comment:
showDiff() can fail to highlight a char-by-char difference because Python difflib seems don't support fully char-by-char comparison.
Please see in Python tracker:
* issue #1528074: "difflib.SequenceMatcher.find_longest_match() wrong result" (http://bugs.python.org/issue1528074)
* issue #1678345: "A fix for the bug #1528074 [warning: quite slow]" (http://bugs.python.org/issue1678345)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1804008&group_…
Revision: 4372
Author: cosoleto
Date: 2007-09-27 18:18:15 +0000 (Thu, 27 Sep 2007)
Log Message:
-----------
fix for my previous commit about Swedish wikis
Modified Paths:
--------------
trunk/pywikipedia/family.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2007-09-27 14:12:09 UTC (rev 4371)
+++ trunk/pywikipedia/family.py 2007-09-27 18:18:15 UTC (rev 4372)
@@ -2258,10 +2258,10 @@
for num, val in namespaces.items():
self.namespaces[num][code]=val
- def get_known_families(self, code):
- if code == 'sv':
- # In Swedish wiki projects 's:' is part of page title
- # not a family prefix for 'wikisource'.
+ def get_known_families(self, site):
+ # In Swedish Wikipedia 's:' is part of page title not a family
+ # prefix for 'wikisource'.
+ if site.lang == 'sv' and site.family.name in ['wikipedia']:
d = self.known_families.copy()
d.pop('s') ; d['src'] = 'wikisource'
return d
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2007-09-27 14:12:09 UTC (rev 4371)
+++ trunk/pywikipedia/wikipedia.py 2007-09-27 18:18:15 UTC (rev 4372)
@@ -304,8 +304,8 @@
if t != '' and t[0] == ':':
self._namespace = 0
t = t[1:]
- elif lowerNs in self.site().family.get_known_families(code = self.site().lang):
- if self.site().get_family.known_families(code = self.site().lang)[lowerNs] == self.site().family.name:
+ elif lowerNs in self.site().family.get_known_families(site = self.site()):
+ if self.site().family.get_known_families(site = self.site())[lowerNs] == self.site().family.name:
t = m.group(2)
else:
# This page is from a different family
@@ -313,7 +313,7 @@
otherlang = self.site().lang
if lowerNs in ['commons']:
otherlang = lowerNs
- familyName = self.site().family.known_families[lowerNs]
+ familyName = self.site().family.get_known_families(site = self.site())[lowerNs]
try:
self._site = getSite(otherlang, familyName)
except ValueError:
@@ -4031,7 +4031,7 @@
return self.isInterwikiLink(rest)
else:
return True
- if first in self.family.get_known_families(code = self.lang):
+ if first in self.family.get_known_families(site = self):
if first == self.family.name:
return self.isInterwikiLink(rest)
else:
Revision: 4371
Author: cosoleto
Date: 2007-09-27 14:12:09 +0000 (Thu, 27 Sep 2007)
Log Message:
-----------
Fix bug #1802910: Swedish wikis (and only they) use 's:t' and 's:a' as an abbreviation for 'saint', 'src' as abbreviation for 'wikisource'. Consequently, added in family.py a get_known_families(code) function.
Modified Paths:
--------------
trunk/pywikipedia/family.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2007-09-27 11:55:26 UTC (rev 4370)
+++ trunk/pywikipedia/family.py 2007-09-27 14:12:09 UTC (rev 4371)
@@ -30,13 +30,13 @@
'tr','tk','tw','udm','bug','uk','ur','vec','vo','fiu-vro','wa',
'vls','war','wo','wuu','ts','ii','yi','yo','zh-yue','cbk-zam','diq','zea','bat-smg','zh',
'zh-tw','zh-cn']
-
+
# knownlanguages is the same list but sorted by code
self.knownlanguages = list(self.alphabetic)
self.knownlanguages.sort()
-
+
self.langs = {}
-
+
# Translation used on all wikis for the different namespaces.
# (Please sort languages alphabetically)
# You only need to enter translations that differ from _default.
@@ -1767,7 +1767,7 @@
# element that contains the actual page content; change this for
# wikis that use something else (e.g., mozilla family)
self.content_id = "bodyContent"
-
+
# A dictionary where keys are family codes that can be used in
# inter-family interwiki links. Values are not used yet.
# Generated from http://tools.wikimedia.de/~daniel/interwiki-en.txt:
@@ -2189,7 +2189,7 @@
# on_one_line is a list of languages that want the category links
# one-after-another on a single line
self.category_on_one_line = []
-
+
# String used as separator between category links and the text
self.category_text_separator = '\r\n\r\n'
@@ -2258,17 +2258,26 @@
for num, val in namespaces.items():
self.namespaces[num][code]=val
+ def get_known_families(self, code):
+ if code == 'sv':
+ # In Swedish wiki projects 's:' is part of page title
+ # not a family prefix for 'wikisource'.
+ d = self.known_families.copy()
+ d.pop('s') ; d['src'] = 'wikisource'
+ return d
+ return self.known_families
+
def linktrail(self, code, fallback = '_default'):
if self.linktrails.has_key(code):
return self.linktrails[code]
elif fallback:
return self.linktrails[fallback]
else:
- raise KeyError('ERROR: linktrail in language %s unknown' % code)
+ raise KeyError('ERROR: linktrail in language %s unknown' % code)
def namespace(self, code, ns_number, fallback = '_default', all = False):
if not self.isDefinedNS(ns_number):
- raise KeyError('ERROR: Unknown namespace %d for %s:%s' % (ns_number, code, self.name))
+ raise KeyError('ERROR: Unknown namespace %d for %s:%s' % (ns_number, code, self.name))
elif self.isNsI18N(ns_number, code):
v = self.namespaces[ns_number][code]
elif fallback:
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2007-09-27 11:55:26 UTC (rev 4370)
+++ trunk/pywikipedia/wikipedia.py 2007-09-27 14:12:09 UTC (rev 4371)
@@ -243,7 +243,7 @@
site = getSite()
elif type(site) in [type(''), type(u'')]:
site = getSite(site)
-
+
self._site = site
if not insite:
@@ -304,8 +304,8 @@
if t != '' and t[0] == ':':
self._namespace = 0
t = t[1:]
- elif lowerNs in self.site().family.known_families:
- if self.site().family.known_families[lowerNs] == self.site().family.name:
+ elif lowerNs in self.site().family.get_known_families(code = self.site().lang):
+ if self.site().get_family.known_families(code = self.site().lang)[lowerNs] == self.site().family.name:
t = m.group(2)
else:
# This page is from a different family
@@ -1357,7 +1357,7 @@
category links in the page text.
"""
try:
- category_links_to_return = getCategoryLinks(self.get(nofollow_redirects=nofollow_redirects), self.site())
+ category_links_to_return = getCategoryLinks(self.get(nofollow_redirects=nofollow_redirects), self.site())
except NoPage:
category_links_to_return = []
return category_links_to_return
@@ -4031,7 +4031,7 @@
return self.isInterwikiLink(rest)
else:
return True
- if first in self.family.known_families:
+ if first in self.family.get_known_families(code = self.lang):
if first == self.family.name:
return self.isInterwikiLink(rest)
else:
Bugs item #1802910, was opened at 2007-09-26 18:29
Message generated for change (Comment added) made by cosoleto
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1802910&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: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alleborgo (alleborgo)
Assigned to: Nobody/Anonymous (nobody)
Summary: interwiki.py - sv.wiki page starting with "S:t something"
Initial Comment:
On sv.wiki there are many articles with the name "S:t something" and when the bot find that goes to search "T something and not "S:t something" which IS the page name you can see the problem here:
http://en.wikipedia.org/w/index.php?title=St._Bernard_%28dog%29&diff=159614…
and here: http://en.wikipedia.org/w/index.php?title=Marttila&diff=152227566&oldid=137…
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto)
Date: 2007-09-27 16:28
Message:
Logged In: YES
user_id=181280
Originator: NO
A fix in revision #4371. This was a general bug, not only interwiki.py
related.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1802910&group_…
Bugs item #1803615, was opened at 2007-09-27 07:10
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1803615&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: Another bug in category.py
Initial Comment:
I have no idea how this bug occurs, but here it is. It doesn't recognize that a simple category already exists in this case, which is strange, since the category I'm adding is Landskrona BoIS and in this case the DEFAULTSORT template is NOT being used in the article.
Current categories:
* Kategori:Födda 1984
* Kategori:Spelare i Häljarps IF
* Kategori:Spelare i IFK Hässleholm
<b>* Kategori:Spelare i Landskrona BoIS</b>
* Kategori:Svenska fotbollsspelare
Adding [[Kategori:Spelare i Landskrona BoIS|Dahlgren, Mikael]]
Very peculiar.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-09-27 07:10
Message:
Logged In: NO
I didn't know that HTML code was disabled in bug descriptions... The HTML
code is of course not being printed in output.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1803615&group_…
Bugs item #1803615, was opened at 2007-09-27 07:10
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=1803615&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: Another bug in category.py
Initial Comment:
I have no idea how this bug occurs, but here it is. It doesn't recognize that a simple category already exists in this case, which is strange, since the category I'm adding is Landskrona BoIS and in this case the DEFAULTSORT template is NOT being used in the article.
Current categories:
* Kategori:Födda 1984
* Kategori:Spelare i Häljarps IF
* Kategori:Spelare i IFK Hässleholm
<b>* Kategori:Spelare i Landskrona BoIS</b>
* Kategori:Svenska fotbollsspelare
Adding [[Kategori:Spelare i Landskrona BoIS|Dahlgren, Mikael]]
Very peculiar.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1803615&group_…
I tried to run the login.py script for our own wikipedia with the local IP
10.0.0.3. But I always get the error message "Wrong password" (see below)
I don't think that I used the wrong password. What else could be wrong?
--- My user-config.py file contains:
family = u'ANA'
mylang = 'de'
usernames['ANA']['de'] = u'ANA-BOT'
--- The output of the command line window: (I'm using WindowsXP SP2)
C:\Python25\pywikipedia>python login.py -pass:AIANA-BOT1
WARNING: Type of 'family' changed
Was: <type 'str'>
Now: <type 'unicode'>
C:\Python25\pywikipedia\simplejson\scanner.py:6: DeprecationWarning: The sre
mod
ule is deprecated, please import re.
from sre import VERBOSE, MULTILINE, DOTALL
Checked for running processes. 1 processes currently running, including the
curr
ent process.
Logging in to ANA:de as ANA-BOT
Login failed. Wrong password?
C:\Python25\pywikipedia>
Thanks Friedrich