Hi people,
Pt wikipedia decided to get a local version of #redirect.
Please update your bots to at least r7390 to prevent a mess (and a block).
Maarten
Hello, maybe somebody could help to solve a strange interwiki bot bug.
Now I often get it when bot is checking articles with some letters with
diacritics, as in example bellow it stops when it founds Spanish letter í.
It also hapens with some Hungarian, Finnish letters. The most strange thing
is that on another computer with the same OS, the same Python version and
the same pywikipedia version everything works perfectly.
C:\Python26\pywikipedia>interwiki.py Kategorija:Lietuvos archeologija
Getting 1 pages from wikipedia:lt...
[[Kategorija:Lietuvos archeologija]]: [[lt:Kategorija:Lietuvos
archeologija]] gi
ves new interwiki [[en:Category:Archaeology of Lithuania]]
Getting 1 pages from wikipedia:en...
[[Kategorija:Lietuvos archeologija]]: [[en:Category:Archaeology of
Lithuania]] g
ives new interwiki [[es:CategorDump lt (wikipedia) saved
Traceback (most recent call last):
File "C:\Python26\pywikipedia\interwiki.py", line 2186, in <module>
bot.run()
File "C:\Python26\pywikipedia\interwiki.py", line 1888, in run
self.queryStep()
File "C:\Python26\pywikipedia\interwiki.py", line 1861, in queryStep
self.oneQuery()
File "C:\Python26\pywikipedia\interwiki.py", line 1857, in oneQuery
subject.batchLoaded(self)
File "C:\Python26\pywikipedia\interwiki.py", line 1210, in batchLoaded
wikipedia.output(u"%s: %s gives new interwiki %s"%
(self.originPage.aslink()
, page.aslink(True), linkedPage.aslink(True)))
File "C:\Python26\pywikipedia\wikipedia.py", line 7421, in output
ui.output(text, toStdout = toStdout)
File "C:\Python26\pywikipedia\userinterfaces\terminal_interface.py", line
221,
in output
self.printColorized(text, targetStream)
File "C:\Python26\pywikipedia\userinterfaces\terminal_interface.py", line
174,
in printColorized
self.printColorizedInWindows(text, targetStream)
File "C:\Python26\pywikipedia\userinterfaces\terminal_interface.py", line
156,
in printColorizedInWindows
targetStream.write(text.encode(config.console_encoding, 'replace'))
IOError: [Errno 42] Illegal byte sequence
Sarunas (User:Hugo.arg)
sorry for this bug, I forgot to check the return type, now it's fixed now.
--Alex Shih-Han Lin
※ 引述《"Patrol110" <patrol110.wikipedia(a)gmail.com>》之郵件內容:
>When I restored files from old svn (wikipedia.py and userlib.py)
>pywikipedia start working properly :)
>
>Patrol
>
>_______________________________________________
>Pywikipedia-l mailing list
>Pywikipedia-l(a)lists.wikimedia.org
>https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>
I've just updated my pywikipedia to the latest version and got very
strange error:
patrol110@toolserv ~/pywikipedia $ python replace.py -help
Traceback (most recent call last):
File "replace.py", line 125, in <module>
import wikipedia, pagegenerators
File "/home/patrol110/pywikipedia/pagegenerators.py", line 164, in <module>
import wikipedia, date, catlib, userlib, query
File "/home/patrol110/pywikipedia/userlib.py", line 251
yield wikipedia.ImagePage(self.site(), info['title']),
info['timestamp'], info['comment'], False
SyntaxError: 'return' with argument inside generator
The problem occurs also when I treid to use replace.py in normal mode.
Patrol
Thank you guys for really quick answer. I didn't suppose taht this
function was available because there was no info in the documentation
about it.
Patrol
Hello,
While writing a bot, I had to discard redirected pages from the XML
dump. In order to be able to do it early, I modified xmlreader.py to
parse the <redirect /> tag and add it to XmlEntry. I'm attaching the
patch, which is not extensively tested.
I haven't updated the regex_parse method since it looks outdated
anyway (it tries to create an XmlEntry with different arguments than
usual).
Best regards,
--
Santiago M. Mola
Jabber ID: cooldwind(a)gmail.com
Hello! I would like to suggest adding new feature to pywikipedia in
replace.py. This feature will give ability to use multipatterns in the
same time and will require adding new parameter e.x.
-multipatt:{number higher than 2}. Why? Because very often many of us,
bot operators, have to change more than one thing in edited articles.
Now it requires typing and executing more than one command which is a
bit time-consuming.
Example of use of a new repalce.py with this feature:
python replace.py -file:mylist -multipatt:2 "old text" "new one"
"another thing to change" "and the replacement"
I will be truly grateful if you add this improvement to replace.py.
Patrol110(a)pl.wiki
Reading: http://meta.wikimedia.org/wiki/Pywikipediabot/imageharvest.py
Note: the real site name I am using is is replaced in the examples. The site
that I am using is accessible at the URL I am using and the images are
available to the public (no login required)
[root@mustang pywikipedia]# python imageharvest.py *-URL:*
http://www.example.org/wiki/
Using the "-URL:" prefix generates a "IOError: [Errno url error] unknown url
type: '-url'" error.
Omitting the "-URL:" prefix allows the process to start, but adds a
redundant */wiki/* to the URL:
[root@mustang pywikipedia]# python imageharvest.py
http://www.example.org/wiki/
What text should be added at the end of the description of each image from
this url? example.org
Include image http://www.example.org/wiki/*/wiki/i*mage:router.gif? ([y]es,
[N]o, [s]top) y
Give the description of this image: Router
Reading file http://www.example.org/wiki/*/wiki/*image:router.gif
Couldn't download the image: the requested URL was not found on this server.
Include image http://www.example.org/wiki/*/wiki/*image:topology.gif?
([y]es, [N]o, [s]top) s
[root@mustang pywikipedia]#
Omitting the /wiki/ in the URL allows the process to start, but it stops
right after the description is entered:
[root@mustang pywikipedia]# python imageharvest.py -v
http://www.example.org/
Pywikipediabot [http] trunk/pywikipedia (r7294, 2009/09/24, 12:37:35)
Python 2.6 (r26:66714, Jun 8 2009, 16:07:26)
[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)]
What text should be added at the end of the description of each image from
this url? example.org
[root@mustang pywikipedia]#
---Robert