Bugs item #3315395, was opened at 2011-06-12 13:47
Message generated for change (Tracker Item Submitted) made by silvonen
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3315395&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: replaceCategoryLinks misplaces featured article links
Initial Comment:
I don't know if this is a known problem, but the function replaceCategoryLinks in pywikibot/textlib.py moves featured/good article templates (e.g., {{Link FA|en}}) above categories, although these templates are usually placed between categories and interwiki links. This has caused problems in one of the bot scripts that we use in the Finnish Wikipedia.
I am attaching a patch proposed by zache.
>python version.py
Pywikipedia [http] trunk/pywikipedia (r9291, 2011/06/10, 04:46:24)
Python 2.5.4 (r254:67916, Jan 29 2009, 12:02:11) [MSC v.1310 32 bit (Intel)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3315395&group_…
Bugs item #3311663, was opened at 2011-06-04 19:20
Message generated for change (Settings changed) made by huji
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&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: Huji Lee (huji)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in duplicate removal code
Initial Comment:
In revision 7461, Alex had added a line to wikipedia.py like this (currently, line 5607):
self._rights[index] = list(set(self._rights[index]))
This is trying to remove duplicates in the _rights dictionary by creating a hash and then converting it back to a list.
I have created a bot to work in TranslateWiki and I get this error when ever the bot tries to save a page on the wiki:
Traceback (most recent call last):
File "dictation.py", line 180, in <module>
main()
File "dictation.py", line 174, in main
bot.run()
File "dictation.py", line 61, in run
self.treat(page)
File "dictation.py", line 83, in treat
if not self.save(text, page, self.summary):
File "dictation.py", line 121, in save
minorEdit=minorEdit, botflag=botflag)
File "/home/hojjat/bot/wikipedia.py", line 1682, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 1555, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 4922, in forceLogin
if not self.loggedInAs(sysop = sysop):
File "/home/hojjat/bot/wikipedia.py", line 4914, in loggedInAs
self._load(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 5994, in _load
self._getUserData(text, sysop = sysop, force = force)
File "/home/hojjat/bot/wikipedia.py", line 5608, in _getUserData
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
TypeError: unhashable type: 'dict'
The last line suggests that the duplicate removal code doesn't work with dictionaries. I tried substituting that line with this:
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
But still got the same error message.
I guess this has something to do with the fact that TranslateWiki uses custom user permissions (other than MediaWiki default). I have attached the family file I created for TranslateWiki for reference.
This is my python version info:
Pywikipedia [svn+ssh] huji@trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-05 16:13
Message:
I fixed the bug in revision 9288. I don't have permissoin on this tracker,
so please close the bug accordingly.
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-05 11:17
Message:
>> Could you write in a new line 5604 "print self._rights[index]" and dump
here the result?
Surely can, and I wonder why I didn't try that myself!
[{u'*': u'*', u'implicit': u''}, {u'*': u'user', u'implicit': u''},
u'bot', u'translator', u'bot', u'autoconfirmed', u'nominornewtalk',
u'autopatrol', u'suppressredirect', u'apihighlimits', u'writeapi',
u'skipcaptcha', u'move', u'move-subpages', u'move-rootuserpages',
u'editinterface', u'translate', u'deletedhistory', u'createaccount',
u'read', u'edit', u'minoredit', u'createpage', u'createtalk', u'upload',
u'reupload', u'reupload-shared', u'purge', u'lqt-split', u'lqt-merge',
u'lqt-react', u'webchat', 'read', 'createaccount', 'edit', 'upload',
'createpage', 'createtalk', 'move', 'upload']
Seems like the first two elements of the list are dicts, which is why I
got that error message. I'm going to trace back to see where these dicts
are being added. In the meantime, do you think it would be a correct fix to
make sure each element of the dict is added as an element in the list? In
other words, if I change this:
...{u'*': u'user', u'implicit': u''}, u'bot', u'translator'...
to this:
u'*', u'user', u'implicit', u'bot', u'translator'
is that okay?
>> except TypeError:
I think duplicate removal is mandatory and except is not the best
workaround. I'm going to try to fix the bug instead.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:41
Message:
I can' t imagine how all the "appends" and "extends" work in the previous
lines if it is a dict rather than a list.
Could you write in a new line 5604 "print self._rights[index]" and dump
here the result? The attached family file has nothing to say about rights.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:05
Message:
Well, I thought nbsb was working here, so indent them naturally.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:04
Message:
Once a type is unhashable, it can't be applied as a dict key either, so the
second try had to fail.
If removing doubles is not vital here, you may use this instead as a
workaround:
try:
self._rights[index] = list(set(self._rights[index]))
except TypeError:
pass
This will prevent the bot of stopping, but leaves duplicates.
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-04 19:23
Message:
Please disregard the first few words about who added that line. I relied on
VIewVC's annotate function, but that lines isn't coming from revision 7461,
apparently.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&group_…
Bugs item #3311663, was opened at 2011-06-04 19:20
Message generated for change (Comment added) made by huji
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&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: Huji Lee (huji)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in duplicate removal code
Initial Comment:
In revision 7461, Alex had added a line to wikipedia.py like this (currently, line 5607):
self._rights[index] = list(set(self._rights[index]))
This is trying to remove duplicates in the _rights dictionary by creating a hash and then converting it back to a list.
I have created a bot to work in TranslateWiki and I get this error when ever the bot tries to save a page on the wiki:
Traceback (most recent call last):
File "dictation.py", line 180, in <module>
main()
File "dictation.py", line 174, in main
bot.run()
File "dictation.py", line 61, in run
self.treat(page)
File "dictation.py", line 83, in treat
if not self.save(text, page, self.summary):
File "dictation.py", line 121, in save
minorEdit=minorEdit, botflag=botflag)
File "/home/hojjat/bot/wikipedia.py", line 1682, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 1555, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 4922, in forceLogin
if not self.loggedInAs(sysop = sysop):
File "/home/hojjat/bot/wikipedia.py", line 4914, in loggedInAs
self._load(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 5994, in _load
self._getUserData(text, sysop = sysop, force = force)
File "/home/hojjat/bot/wikipedia.py", line 5608, in _getUserData
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
TypeError: unhashable type: 'dict'
The last line suggests that the duplicate removal code doesn't work with dictionaries. I tried substituting that line with this:
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
But still got the same error message.
I guess this has something to do with the fact that TranslateWiki uses custom user permissions (other than MediaWiki default). I have attached the family file I created for TranslateWiki for reference.
This is my python version info:
Pywikipedia [svn+ssh] huji@trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
>Comment By: Huji Lee (huji)
Date: 2011-06-05 16:13
Message:
I fixed the bug in revision 9288. I don't have permissoin on this tracker,
so please close the bug accordingly.
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-05 11:17
Message:
>> Could you write in a new line 5604 "print self._rights[index]" and dump
here the result?
Surely can, and I wonder why I didn't try that myself!
[{u'*': u'*', u'implicit': u''}, {u'*': u'user', u'implicit': u''},
u'bot', u'translator', u'bot', u'autoconfirmed', u'nominornewtalk',
u'autopatrol', u'suppressredirect', u'apihighlimits', u'writeapi',
u'skipcaptcha', u'move', u'move-subpages', u'move-rootuserpages',
u'editinterface', u'translate', u'deletedhistory', u'createaccount',
u'read', u'edit', u'minoredit', u'createpage', u'createtalk', u'upload',
u'reupload', u'reupload-shared', u'purge', u'lqt-split', u'lqt-merge',
u'lqt-react', u'webchat', 'read', 'createaccount', 'edit', 'upload',
'createpage', 'createtalk', 'move', 'upload']
Seems like the first two elements of the list are dicts, which is why I
got that error message. I'm going to trace back to see where these dicts
are being added. In the meantime, do you think it would be a correct fix to
make sure each element of the dict is added as an element in the list? In
other words, if I change this:
...{u'*': u'user', u'implicit': u''}, u'bot', u'translator'...
to this:
u'*', u'user', u'implicit', u'bot', u'translator'
is that okay?
>> except TypeError:
I think duplicate removal is mandatory and except is not the best
workaround. I'm going to try to fix the bug instead.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:41
Message:
I can' t imagine how all the "appends" and "extends" work in the previous
lines if it is a dict rather than a list.
Could you write in a new line 5604 "print self._rights[index]" and dump
here the result? The attached family file has nothing to say about rights.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:05
Message:
Well, I thought nbsb was working here, so indent them naturally.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:04
Message:
Once a type is unhashable, it can't be applied as a dict key either, so the
second try had to fail.
If removing doubles is not vital here, you may use this instead as a
workaround:
try:
self._rights[index] = list(set(self._rights[index]))
except TypeError:
pass
This will prevent the bot of stopping, but leaves duplicates.
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-04 19:23
Message:
Please disregard the first few words about who added that line. I relied on
VIewVC's annotate function, but that lines isn't coming from revision 7461,
apparently.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&group_…
Bugs item #3311663, was opened at 2011-06-04 19:20
Message generated for change (Comment added) made by huji
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&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: Huji Lee (huji)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in duplicate removal code
Initial Comment:
In revision 7461, Alex had added a line to wikipedia.py like this (currently, line 5607):
self._rights[index] = list(set(self._rights[index]))
This is trying to remove duplicates in the _rights dictionary by creating a hash and then converting it back to a list.
I have created a bot to work in TranslateWiki and I get this error when ever the bot tries to save a page on the wiki:
Traceback (most recent call last):
File "dictation.py", line 180, in <module>
main()
File "dictation.py", line 174, in main
bot.run()
File "dictation.py", line 61, in run
self.treat(page)
File "dictation.py", line 83, in treat
if not self.save(text, page, self.summary):
File "dictation.py", line 121, in save
minorEdit=minorEdit, botflag=botflag)
File "/home/hojjat/bot/wikipedia.py", line 1682, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 1555, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 4922, in forceLogin
if not self.loggedInAs(sysop = sysop):
File "/home/hojjat/bot/wikipedia.py", line 4914, in loggedInAs
self._load(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 5994, in _load
self._getUserData(text, sysop = sysop, force = force)
File "/home/hojjat/bot/wikipedia.py", line 5608, in _getUserData
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
TypeError: unhashable type: 'dict'
The last line suggests that the duplicate removal code doesn't work with dictionaries. I tried substituting that line with this:
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
But still got the same error message.
I guess this has something to do with the fact that TranslateWiki uses custom user permissions (other than MediaWiki default). I have attached the family file I created for TranslateWiki for reference.
This is my python version info:
Pywikipedia [svn+ssh] huji@trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
>Comment By: Huji Lee (huji)
Date: 2011-06-05 11:17
Message:
>> Could you write in a new line 5604 "print self._rights[index]" and dump
here the result?
Surely can, and I wonder why I didn't try that myself!
[{u'*': u'*', u'implicit': u''}, {u'*': u'user', u'implicit': u''},
u'bot', u'translator', u'bot', u'autoconfirmed', u'nominornewtalk',
u'autopatrol', u'suppressredirect', u'apihighlimits', u'writeapi',
u'skipcaptcha', u'move', u'move-subpages', u'move-rootuserpages',
u'editinterface', u'translate', u'deletedhistory', u'createaccount',
u'read', u'edit', u'minoredit', u'createpage', u'createtalk', u'upload',
u'reupload', u'reupload-shared', u'purge', u'lqt-split', u'lqt-merge',
u'lqt-react', u'webchat', 'read', 'createaccount', 'edit', 'upload',
'createpage', 'createtalk', 'move', 'upload']
Seems like the first two elements of the list are dicts, which is why I
got that error message. I'm going to trace back to see where these dicts
are being added. In the meantime, do you think it would be a correct fix to
make sure each element of the dict is added as an element in the list? In
other words, if I change this:
...{u'*': u'user', u'implicit': u''}, u'bot', u'translator'...
to this:
u'*', u'user', u'implicit', u'bot', u'translator'
is that okay?
>> except TypeError:
I think duplicate removal is mandatory and except is not the best
workaround. I'm going to try to fix the bug instead.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:41
Message:
I can' t imagine how all the "appends" and "extends" work in the previous
lines if it is a dict rather than a list.
Could you write in a new line 5604 "print self._rights[index]" and dump
here the result? The attached family file has nothing to say about rights.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:05
Message:
Well, I thought nbsb was working here, so indent them naturally.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 01:04
Message:
Once a type is unhashable, it can't be applied as a dict key either, so the
second try had to fail.
If removing doubles is not vital here, you may use this instead as a
workaround:
try:
self._rights[index] = list(set(self._rights[index]))
except TypeError:
pass
This will prevent the bot of stopping, but leaves duplicates.
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-04 19:23
Message:
Please disregard the first few words about who added that line. I relied on
VIewVC's annotate function, but that lines isn't coming from revision 7461,
apparently.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&group_…
Bugs item #3311663, was opened at 2011-06-05 01:20
Message generated for change (Comment added) made by binbot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&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: Huji Lee (huji)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in duplicate removal code
Initial Comment:
In revision 7461, Alex had added a line to wikipedia.py like this (currently, line 5607):
self._rights[index] = list(set(self._rights[index]))
This is trying to remove duplicates in the _rights dictionary by creating a hash and then converting it back to a list.
I have created a bot to work in TranslateWiki and I get this error when ever the bot tries to save a page on the wiki:
Traceback (most recent call last):
File "dictation.py", line 180, in <module>
main()
File "dictation.py", line 174, in main
bot.run()
File "dictation.py", line 61, in run
self.treat(page)
File "dictation.py", line 83, in treat
if not self.save(text, page, self.summary):
File "dictation.py", line 121, in save
minorEdit=minorEdit, botflag=botflag)
File "/home/hojjat/bot/wikipedia.py", line 1682, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 1555, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 4922, in forceLogin
if not self.loggedInAs(sysop = sysop):
File "/home/hojjat/bot/wikipedia.py", line 4914, in loggedInAs
self._load(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 5994, in _load
self._getUserData(text, sysop = sysop, force = force)
File "/home/hojjat/bot/wikipedia.py", line 5608, in _getUserData
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
TypeError: unhashable type: 'dict'
The last line suggests that the duplicate removal code doesn't work with dictionaries. I tried substituting that line with this:
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
But still got the same error message.
I guess this has something to do with the fact that TranslateWiki uses custom user permissions (other than MediaWiki default). I have attached the family file I created for TranslateWiki for reference.
This is my python version info:
Pywikipedia [svn+ssh] huji@trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 07:41
Message:
I can' t imagine how all the "appends" and "extends" work in the previous
lines if it is a dict rather than a list.
Could you write in a new line 5604 "print self._rights[index]" and dump
here the result? The attached family file has nothing to say about rights.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 07:05
Message:
Well, I thought nbsb was working here, so indent them naturally.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 07:04
Message:
Once a type is unhashable, it can't be applied as a dict key either, so the
second try had to fail.
If removing doubles is not vital here, you may use this instead as a
workaround:
try:
self._rights[index] = list(set(self._rights[index]))
except TypeError:
pass
This will prevent the bot of stopping, but leaves duplicates.
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-05 01:23
Message:
Please disregard the first few words about who added that line. I relied on
VIewVC's annotate function, but that lines isn't coming from revision 7461,
apparently.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&group_…
Bugs item #3311663, was opened at 2011-06-05 01:20
Message generated for change (Comment added) made by binbot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&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: Huji Lee (huji)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in duplicate removal code
Initial Comment:
In revision 7461, Alex had added a line to wikipedia.py like this (currently, line 5607):
self._rights[index] = list(set(self._rights[index]))
This is trying to remove duplicates in the _rights dictionary by creating a hash and then converting it back to a list.
I have created a bot to work in TranslateWiki and I get this error when ever the bot tries to save a page on the wiki:
Traceback (most recent call last):
File "dictation.py", line 180, in <module>
main()
File "dictation.py", line 174, in main
bot.run()
File "dictation.py", line 61, in run
self.treat(page)
File "dictation.py", line 83, in treat
if not self.save(text, page, self.summary):
File "dictation.py", line 121, in save
minorEdit=minorEdit, botflag=botflag)
File "/home/hojjat/bot/wikipedia.py", line 1682, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 1555, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 4922, in forceLogin
if not self.loggedInAs(sysop = sysop):
File "/home/hojjat/bot/wikipedia.py", line 4914, in loggedInAs
self._load(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 5994, in _load
self._getUserData(text, sysop = sysop, force = force)
File "/home/hojjat/bot/wikipedia.py", line 5608, in _getUserData
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
TypeError: unhashable type: 'dict'
The last line suggests that the duplicate removal code doesn't work with dictionaries. I tried substituting that line with this:
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
But still got the same error message.
I guess this has something to do with the fact that TranslateWiki uses custom user permissions (other than MediaWiki default). I have attached the family file I created for TranslateWiki for reference.
This is my python version info:
Pywikipedia [svn+ssh] huji@trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 07:05
Message:
Well, I thought nbsb was working here, so indent them naturally.
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 07:04
Message:
Once a type is unhashable, it can't be applied as a dict key either, so the
second try had to fail.
If removing doubles is not vital here, you may use this instead as a
workaround:
try:
self._rights[index] = list(set(self._rights[index]))
except TypeError:
pass
This will prevent the bot of stopping, but leaves duplicates.
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-05 01:23
Message:
Please disregard the first few words about who added that line. I relied on
VIewVC's annotate function, but that lines isn't coming from revision 7461,
apparently.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&group_…
Bugs item #3311663, was opened at 2011-06-05 01:20
Message generated for change (Comment added) made by binbot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&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: Huji Lee (huji)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in duplicate removal code
Initial Comment:
In revision 7461, Alex had added a line to wikipedia.py like this (currently, line 5607):
self._rights[index] = list(set(self._rights[index]))
This is trying to remove duplicates in the _rights dictionary by creating a hash and then converting it back to a list.
I have created a bot to work in TranslateWiki and I get this error when ever the bot tries to save a page on the wiki:
Traceback (most recent call last):
File "dictation.py", line 180, in <module>
main()
File "dictation.py", line 174, in main
bot.run()
File "dictation.py", line 61, in run
self.treat(page)
File "dictation.py", line 83, in treat
if not self.save(text, page, self.summary):
File "dictation.py", line 121, in save
minorEdit=minorEdit, botflag=botflag)
File "/home/hojjat/bot/wikipedia.py", line 1682, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 1555, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 4922, in forceLogin
if not self.loggedInAs(sysop = sysop):
File "/home/hojjat/bot/wikipedia.py", line 4914, in loggedInAs
self._load(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 5994, in _load
self._getUserData(text, sysop = sysop, force = force)
File "/home/hojjat/bot/wikipedia.py", line 5608, in _getUserData
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
TypeError: unhashable type: 'dict'
The last line suggests that the duplicate removal code doesn't work with dictionaries. I tried substituting that line with this:
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
But still got the same error message.
I guess this has something to do with the fact that TranslateWiki uses custom user permissions (other than MediaWiki default). I have attached the family file I created for TranslateWiki for reference.
This is my python version info:
Pywikipedia [svn+ssh] huji@trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
Comment By: Binris (binbot)
Date: 2011-06-05 07:04
Message:
Once a type is unhashable, it can't be applied as a dict key either, so the
second try had to fail.
If removing doubles is not vital here, you may use this instead as a
workaround:
try:
self._rights[index] = list(set(self._rights[index]))
except TypeError:
pass
This will prevent the bot of stopping, but leaves duplicates.
----------------------------------------------------------------------
Comment By: Huji Lee (huji)
Date: 2011-06-05 01:23
Message:
Please disregard the first few words about who added that line. I relied on
VIewVC's annotate function, but that lines isn't coming from revision 7461,
apparently.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&group_…
Bugs item #3311663, was opened at 2011-06-05 03:50
Message generated for change (Comment added) made by huji
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&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: Huji (huji)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in duplicate removal code
Initial Comment:
In revision 7461, Alex had added a line to wikipedia.py like this (currently, line 5607):
self._rights[index] = list(set(self._rights[index]))
This is trying to remove duplicates in the _rights dictionary by creating a hash and then converting it back to a list.
I have created a bot to work in TranslateWiki and I get this error when ever the bot tries to save a page on the wiki:
Traceback (most recent call last):
File "dictation.py", line 180, in <module>
main()
File "dictation.py", line 174, in main
bot.run()
File "dictation.py", line 61, in run
self.treat(page)
File "dictation.py", line 83, in treat
if not self.save(text, page, self.summary):
File "dictation.py", line 121, in save
minorEdit=minorEdit, botflag=botflag)
File "/home/hojjat/bot/wikipedia.py", line 1682, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 1555, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 4922, in forceLogin
if not self.loggedInAs(sysop = sysop):
File "/home/hojjat/bot/wikipedia.py", line 4914, in loggedInAs
self._load(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 5994, in _load
self._getUserData(text, sysop = sysop, force = force)
File "/home/hojjat/bot/wikipedia.py", line 5608, in _getUserData
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
TypeError: unhashable type: 'dict'
The last line suggests that the duplicate removal code doesn't work with dictionaries. I tried substituting that line with this:
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
But still got the same error message.
I guess this has something to do with the fact that TranslateWiki uses custom user permissions (other than MediaWiki default). I have attached the family file I created for TranslateWiki for reference.
This is my python version info:
Pywikipedia [svn+ssh] huji@trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
>Comment By: Huji (huji)
Date: 2011-06-05 03:53
Message:
Please disregard the first few words about who added that line. I relied on
VIewVC's annotate function, but that lines isn't coming from revision 7461,
apparently.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&group_…
Bugs item #3311663, was opened at 2011-06-05 03:50
Message generated for change (Tracker Item Submitted) made by huji
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&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: Huji (huji)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in duplicate removal code
Initial Comment:
In revision 7461, Alex had added a line to wikipedia.py like this (currently, line 5607):
self._rights[index] = list(set(self._rights[index]))
This is trying to remove duplicates in the _rights dictionary by creating a hash and then converting it back to a list.
I have created a bot to work in TranslateWiki and I get this error when ever the bot tries to save a page on the wiki:
Traceback (most recent call last):
File "dictation.py", line 180, in <module>
main()
File "dictation.py", line 174, in main
bot.run()
File "dictation.py", line 61, in run
self.treat(page)
File "dictation.py", line 83, in treat
if not self.save(text, page, self.summary):
File "dictation.py", line 121, in save
minorEdit=minorEdit, botflag=botflag)
File "/home/hojjat/bot/wikipedia.py", line 1682, in put
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 1555, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 4922, in forceLogin
if not self.loggedInAs(sysop = sysop):
File "/home/hojjat/bot/wikipedia.py", line 4914, in loggedInAs
self._load(sysop = sysop)
File "/home/hojjat/bot/wikipedia.py", line 5994, in _load
self._getUserData(text, sysop = sysop, force = force)
File "/home/hojjat/bot/wikipedia.py", line 5608, in _getUserData
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
TypeError: unhashable type: 'dict'
The last line suggests that the duplicate removal code doesn't work with dictionaries. I tried substituting that line with this:
self._rights[index] = dict.fromkeys(self._rights[index]).keys()
But still got the same error message.
I guess this has something to do with the fact that TranslateWiki uses custom user permissions (other than MediaWiki default). I have attached the family file I created for TranslateWiki for reference.
This is my python version info:
Pywikipedia [svn+ssh] huji@trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311663&group_…
Bugs item #3311532, was opened at 2011-06-04 16:24
Message generated for change (Comment added) made by malafaya
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311532&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: 6
Private: No
Submitted By: Andr Malafaya Baptista (malafaya)
Assigned to: Nobody/Anonymous (nobody)
Summary: -start:Category:! ending on letter B
Initial Comment:
I ran the command:
interwiki.py -family:wiktionary -lang:es -async -auto -cleanup -pt:1 -start:Category:!
but the bot stopped on categories starting with B, as if there was nothing else to process.
I'm not sure why it's doing that.
Pywikipedia [http] trunk/pywikipedia (r9287, 2011/06/04, 10:13:18)
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
>Comment By: Andr Malafaya Baptista (malafaya)
Date: 2011-06-04 23:01
Message:
I'm not sure if this helps but the categories retrieved seem to go back at
some point.
With -start:Category:D, I got this output at some stage, where it goes
back to categories starting with numbers:
======Post-processing [[es:Categora:Dhivehi]]======
No changes needed on page [[pt:Categoria:Divehi]]
No changes needed on page [[en:Category:Dhivehi language]]
No changes needed on page [[el:Katigora:Glssa ntibe?]]
No changes needed on page [[lt:Kategorija:Maldyvu kalba]]
No changes needed on page [[sv:Kategori:Divehi]]
No changes needed on page [[es:Categora:Dhivehi]]
No changes needed on page [[ro:Categorie:Divehi]]
No changes needed on page [[fr:Cat'gorie:divehi]]
NOTE: The first unfinished subject is [[es:Categora:Dan's]]
NOTE: Number of pages queued is 99, trying to add 60 more.
Getting 60 pages from wiktionary:es...
NOTE: [[es:Categora:01 trazo]] does not have any interwiki links
NOTE: [[es:Categora:02 trazos]] does not have any interwiki links
NOTE: [[es:Categora:03 trazos]] does not have any interwiki links
NOTE: [[es:Categora:04 trazos]] does not have any interwiki links
NOTE: [[es:Categora:05 trazos]] does not have any interwiki links
NOTE: [[es:Categora:06 trazos]] does not have any interwiki links
NOTE: [[es:Categora:07 trazos]] does not have any interwiki links
NOTE: [[es:Categora:08 trazos]] does not have any interwiki links
NOTE: [[es:Categora:09 trazos]] does not have any interwiki links
NOTE: [[es:Categora:10 letras]] does not have any interwiki links
NOTE: [[es:Categora:10 trazos]] does not have any interwiki links
NOTE: [[es:Categora:11 letras]] does not have any interwiki links
NOTE: [[es:Categora:11 trazos]] does not have any interwiki links
NOTE: [[es:Categora:12 trazos]] does not have any interwiki links
NOTE: [[es:Categora:13 trazos]] does not have any interwiki links
NOTE: [[es:Categora:14 trazos]] does not have any interwiki links
NOTE: [[es:Categora:15 trazos]] does not have any interwiki links
NOTE: [[es:Categora:17 trazos]] does not have any interwiki links
NOTE: [[es:Categora:19 trazos]] does not have any interwiki links
NOTE: [[es:Categora:20 trazos]] does not have any interwiki links
NOTE: [[es:Categora:3 letras]] does not have any interwiki links
NOTE: [[es:Categora:4 letras]] does not have any interwiki links
NOTE: [[es:Categora:5 letras]] does not have any interwiki links
NOTE: [[es:Categora:6 letras]] does not have any interwiki links
NOTE: [[es:Categora:7 letras]] does not have any interwiki links
NOTE: [[es:Categora:8 letras]] does not have any interwiki links
NOTE: [[es:Categora:9 letras]] does not have any interwiki links
----------------------------------------------------------------------
Comment By: Andr Malafaya Baptista (malafaya)
Date: 2011-06-04 17:30
Message:
Actually, no. It stopped on E, curiously enough, after processing some
categories starting with A...
----------------------------------------------------------------------
Comment By: Andr Malafaya Baptista (malafaya)
Date: 2011-06-04 16:52
Message:
If I do -start:Category:B, then it seems to run ok from then on until the
end.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3311532&group_…