Last modified: 2014-04-21 22:12:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66087, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64087 - Invalid index to a set in category.py
Invalid index to a set in category.py
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
category.py (Other open bugs)
core-(2.0)
All All
: Normal normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-18 14:12 UTC by xqt
Modified: 2014-04-21 22:12 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description xqt 2014-04-18 14:12:41 UTC
Bug reported by pyfisch:


[michael@michaellaptop pywikibot-core]$ python2 scripts/category.py tidy
Which category do you want to tidy up? Deutschland
Retrieving 1 pages from wikipedia:de.
===================================================================Treating page Deutschland, currently in Kategorie:Deutschland{{Dieser Artikel|behandelt den deutschen Staat, im engeren Sinn die Bundesrepublik Deutschland; zu weiteren Bedeutungen siehe [[Deutschla ### More Text here

Dumping to category.dump.bz2, please wait...
Traceback (most recent call last):  File "scripts/category.py", line 1087, in <module>    main()  
  File "scripts/category.py", line 1061, in main
    bot.run()
  File "scripts/category.py", line 842, in run
    self.move_to_category(article, cat, cat)
  File "scripts/category.py", line 761, in move_to_category
    % (i, supercatlist[i].title()))
TypeError: 'set' object does not support indexing<type 'exceptions.TypeError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

This is what I get when I try to run category.py tidy as it is currently in Git. I do not see any advantages of of CategoryDB and I want to remove it in another commit. It only adds complexity to the code, is broken, sometimes you will have outdated data in the database, and even with a 2Mbit connection you can fetch thousands of articles from the internet every second. If there should be some kind of caching in Pywikibot this should be done in the core of the framework, not in independent scripts for special use cases.
Comment 1 xqt 2014-04-18 14:18:29 UTC
Bug was introduced by https://www.mediawiki.org/wiki/Special:Code/pywikipedia/6428 where lists where replaced by sets.
Comment 2 Gerrit Notification Bot 2014-04-18 14:51:27 UTC
Change 127251 had a related patch set uploaded by Xqt:
(bug 64087) fix for indexing set in category.py

https://gerrit.wikimedia.org/r/127251
Comment 3 Gerrit Notification Bot 2014-04-21 08:42:51 UTC
Change 127251 merged by jenkins-bot:
(bug 64087) fix for indexing set in category.py; code improvements

https://gerrit.wikimedia.org/r/127251

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links