Hi Binaris,
I did it. I removed re.compile() from the textlib method because it never found any section with unicode chars. I'll try to examine this weekend.
Regards
Xqt
----- Ursprüngliche Nachricht -----
Von: Bináris
Gesendet: 06.07.2013 00:17
An: Pywikipedia discussion list
Betreff: [Pywikipedia-l] Script halted, textlib.py?
Hi, this is a message from the server running masvita.py.
The only change in code since the last successful run is here:
http://hu.wikipedia.org/w/index.php?title=Szerkeszt%C5%91:BinBot/masvita.py…
This is also the source of my script.
The error message is below and it mentions textlib.py at the end. Has anything changed? I can't imagine how my above modification in the quoted text could cause the crash.
---------- Forwarded message ----------
From: Cron Daemon <root(a)tron.wmm.hu>
Date: 2013/7/2
Subject: Cron <binaris@tron> bash weekofmonth 1 python pywikipedia/masvita.py > /dev/null
To: wikiposta+tron(a)gmail.com
No handlers could be found for logger "pywiki"
NOTE: You have new messages on wikipedia:hu
Getting references to [[Sablon:Másvita]] via API...
Reading section info from [[Wikipédia:Kocsmafal (egyéb)/Archív53]] via API...
A pywikipedia/masvita.py 09:02-kor megszakadt.
A feldolgozás során mentési hiba nem történt.
Email sent.
Traceback (most recent call last):
File "pywikipedia/masvita.py", line 279, in <module>
main()
File "pywikipedia/masvita.py", line 273, in main
bot.run()
File "pywikipedia/masvita.py", line 208, in run
comment += self.commenttext(self.found(archtitle), False)
File "pywikipedia/masvita.py", line 134, in found
section.get()
File "/home/binaris/pywikipedia/wikipedia.py", line 741, in get
expandtemplates = expandtemplates)
File "/home/binaris/pywikipedia/wikipedia.py", line 881, in _getEditPage
not does_text_contain_section(pagetext, self.section()):
File "/home/binaris/pywikipedia/pywikibot/textlib.py", line 1078, in does_text_contain_section
m = re.search("=+[ ']*%s[ ']*=+" % section, pagetext)
File "/usr/lib/python2.7/re.py", line 142, in search
return _compile(pattern, flags).search(string)
File "/usr/lib/python2.7/re.py", line 244, in _compile
raise error, v # invalid expression
sre_constants.error: multiple repeat
--
Bináris
Hi, this is a message from the server running masvita.py.
The only change in code since the last successful run is here:
http://hu.wikipedia.org/w/index.php?title=Szerkeszt%C5%91:BinBot/masvita.py…
This is also the source of my script.
The error message is below and it mentions textlib.py at the end. Has
anything changed? I can't imagine how my above modification in the quoted
text could cause the crash.
---------- Forwarded message ----------
From: Cron Daemon <root(a)tron.wmm.hu>
Date: 2013/7/2
Subject: Cron <binaris@tron> bash weekofmonth 1 python
pywikipedia/masvita.py > /dev/null
To: wikiposta+tron(a)gmail.com
No handlers could be found for logger "pywiki"
NOTE: You have new messages on wikipedia:hu
Getting references to [[Sablon:Másvita]] via API...
Reading section info from [[Wikipédia:Kocsmafal (egyéb)/Archív53]] via
API...
A pywikipedia/masvita.py 09:02-kor megszakadt.
A feldolgozás során mentési hiba nem történt.
Email sent.
Traceback (most recent call last):
File "pywikipedia/masvita.py", line 279, in <module>
main()
File "pywikipedia/masvita.py", line 273, in main
bot.run()
File "pywikipedia/masvita.py", line 208, in run
comment += self.commenttext(self.found(archtitle), False)
File "pywikipedia/masvita.py", line 134, in found
section.get()
File "/home/binaris/pywikipedia/wikipedia.py", line 741, in get
expandtemplates = expandtemplates)
File "/home/binaris/pywikipedia/wikipedia.py", line 881, in _getEditPage
not does_text_contain_section(pagetext, self.section()):
File "/home/binaris/pywikipedia/pywikibot/textlib.py", line 1078, in
does_text_contain_section
m = re.search("=+[ ']*%s[ ']*=+" % section, pagetext)
File "/usr/lib/python2.7/re.py", line 142, in search
return _compile(pattern, flags).search(string)
File "/usr/lib/python2.7/re.py", line 244, in _compile
raise error, v # invalid expression
sre_constants.error: multiple repeat
--
Bináris
Hi,
I wanted to update Pywikipedia as I had read that git is ante portas, and
got this message. I never saw this previously. All I know is that my
computer had a WIndows crash last night. How can I remove the lock and
update Pywiki? (TortoiseSVN)
Command: Update
Error: Working copy 'C:\Pywikipedia' locked.
Error: 'C:\Pywikipedia' is already locked.
Completed!:
--
Bináris
I try to use rewrite lately, but I encounter something difficult to reslove.
--------
import pywikibot
class TestBot:
def run(self):
pywikibot.output(pywikibot.input('a'))
def main():
bot = TestBot()
bot.run()
if __name__ == "__main__":
try:
main()
finally:
pass
----------
While test case is "pwb test"
When I type "字母频率", which "频" is not supported by cp950, it shows "
字母?率" but "字母频率" is expected. In the same time, while using the
same script in Pywikipedia, it correctly shows "字母频率.
Here is something stranger, if "学校" is used, the following error is given:
D:\pywikipedia>pwb test
a 学校
Traceback (most recent call last):
File "D:\pywikipedia\pwb.py", line 50, in <module>
execfile(sys.argv[0])
File "D:\pywikipedia\scripts\self\test.py", line 21, in <module>
main()
File "D:\pywikipedia\scripts\self\test.py", line 17, in main
bot.run()
File "D:\pywikipedia\scripts\self\test.py", line 13, in run
pywikibot.output(pywikibot.input('a'))
File "D:\pywikipedia\pywikibot\bot.py", line 450, in input
data = ui.input(question, password)
File "D:\pywikipedia\pywikibot\userinterfaces\terminal_interface.py",
line 196, in input
text = unicode(text, config.console_encoding)
UnicodeDecodeError: 'cp950' codec can't decode bytes in position 0-1:
illegal multibyte sequence
When I try to do some tests myself, print(self.encoding) of
terminal_interface_base.py of pywikipedia gives utf-8, while
config.console_encoding of terminal_interface.py of rewrite gives cp950.
Can somebody help?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello all!
Following issue: I am up re-organizing the whole "externals" part in
trunk as you might have recognized already. In fact this is done now
with the single exception of a generic patching system, e.g. needed
for BeautifulSoup.py. (As usual) this is no problem under linux, but
becomes a major issue under win.
The mechanism I want to use is the well known diff-patch duo.
Therefore a "patch" executable/binary (OR python script) is needed
(for every OS). While this is kind of "built-in" in linux, win needs
extra-attention. This is what I found so far:
* http://sourceforge.net/projects/unxutils/
The executables do only depend on the Microsoft C-runtime
(msvcrt.dll) and not on an emulation layer like that provided by
Cygwin tools - windows ONLY not multi OS
* http://python-patch.googlecode.com/svn/trunk/patch.py
Python script therefore multi OS - but does not support the full
diff-patch "command set" e.g. cannot create new files
* https://code.google.com/p/google-diff-match-patch/
Not a command-line tool like "patch" but a python library/module.
Multi OS.
So I am stuck here and need some further knowledge, experience and
personal preferences from your side in order to make a good decicion.
In my opinion we should also keep further os (than just linux, mac,
win) in our mind, becuase they are very close to what we already have too.
Thanks for any help and Greetings
DrTrigon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlGghyQACgkQAXWvBxzBrDBgwQCgpIQi+omcb2mZHRtqvGs48EO1
6OIAmgNAQqz/00mdJuX6uiJtEoSdOzNC
=5mCh
-----END PGP SIGNATURE-----
Hi... I'm a long time editor over at LOTRO-wiki.com.
Just beginning to learn about bots, because all of the others who have done bots in the past have become inactive.
I am long-time Mac based, and a retired Unix Sys Admin, so the innards of OSX are not strange to me.
I have begun to update: www.mediawiki.org/wiki/Manual:Pywikipediabot/Mac -- those first updates are hanging waiting for someone to approve them.
Two things have jumped out at me...
1- in the SVN download there is an error:
U pywikipedia/externals/simplejson
Checked out external at revision 242.
Error validating server certificate for 'https://svn.toolserver.org:443':
- The certificate is not issued by a trusted authority. Use the
fingerprint to validate the certificate manually!
Certificate information:
- Hostname: *.toolserver.org
- Valid: from Sun, 26 May 2013 09:34:24 GMT until Wed, 28 May 2014 17:08:01 GMT
- Issuer: GeoTrust, Inc., US
- Fingerprint: bf:35:7f:3e:62:4b:89:6c:bc:39:c9:c3:38:81:9e:53:26:43:be:f4
(R)eject, accept (t)emporarily or accept (p)ermanently? p
svn: warning: Error handling externals definition for 'pywikipedia/externals/pycolorname':
svn: warning: OPTIONS of 'https://svn.toolserver.org/svnroot/drtrigon/externals/pycolorname': Could not read status line: connection was closed by server (https://svn.toolserver.org)
Fetching external item into 'pywikipedia/externals/opencv'
The first error is Apple's Gatekeeper objecting to the Certificate... no big deal.
However, on accepting the certificate, the SVN throws an error attempting 'pywikipedia/externals/pycolorname'
2- In the instructions in Manual:Pywikipediabot/Mac, the first thing they have you do is to edit "user-config.py"
This file does not exist in the current SVN download.
======
The included README says nothing useful.
The README file in the docs directory says the following:
"This directory/folder is empty when you get the package. Change to the
parent directory (containing 'Doxyfile' and 'setup.cfg') and run the
release maintenance script with 'python maintenance/release.py' to fill
this directory with documentation data."
As I am attempting to document the step-by-step process of installing "pywikipediabot" on the Mac, the immediate question is...
Is the above instruction the FIRST thing to be done when a virgin copy of pywikipediabot" is downloaded from the SVN.
i.e. to a system which has never had it installed before... and therefore has no user-config.py file to edit.
OR... should "setup.cfg" be modified to create it?
OR (based on comments in CONTENTS) should "generate_user_files.py" -- be run first?
OR "config.py"?
T.T.F.N.
William H. Magill
magill(a)icloud.com
magill(a)mac.com
whmagill(a)gmail.com