-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I tried several things here in order to investigate the origin of this issue. E.g.:
'Site.forceLogin()' does not help - essentially the same happens.
Then I recognized that there is the login, there are cookies and last but not least there is the 'LoginManager'. The strange thing now is; when starting the bot it get logged in into dewiki without any message or else (just works fine), then when accessing another wiki it obviousely tries to login there and forgets the dewiki login. But finally when coming back to dewiki the second time the 'LoginManager' gets used (this is not the case for the initial login) and asks for a password, but I can just press <enter> there (skip it) and the 'LoginManager' uses the cookies then and logs in even though no valid password was given...
So I do not understand how the initial login (by cookies) is done and at what place in the code? Then I do not understand why the later (re)login is done in a different way? And last I do no under- stand why 'LoginManager' ask for a password but does not need it, if there are cookies present? (this requested user input seems to break my bot then...)
Any help is greatly appreciated... Thanks in advance!
Gretings
On 27.01.2012 18:06, Dr. Trigon wrote:
...forgot to add when using an API URL link for same wikis the issue DOES NOT appear.
On 27.01.2012 17:31, Dr. Trigon wrote:
Hello all!
I have a quite confusing situation happening to my bot when trying to access any URL that points to foreign (but mediawiki software) wiki, like this:
pywikibot.getSite().getUrl(foreign_wiki_url, no_hostname = True)
This should be more or less similar to a simple:
urllib.urlopen(foreign_wiki_url).read()
I mean I am not trying to edit or access that other wiki in a usual way (I have not login there, no family file, ...) I just want to fetch the HTML text from that page - which actually works. But while doing this the bot seems to log-out since afterwards it is not able to edit any page anymore the "traceback" from the logs is:
- Password for user DrTrigonBot on wikipedia:de: *
/opt/ts/python/2.7/lib/python2.7/getpass.py:83: GetPassWarning: Can not control echo on the terminal. * passwd = fallback_getpass(prompt, stream) * Warning: Password input may be echoed. * * Unhandled exception in thread started by * * Traceback (most recent call last): * File "/home/drtrigon/pywikipedia/bot_control.py", line 317, in write
- string = self._REGEX_boc.sub('', string) # make more readable
- File "/home/drtrigon/pywikipedia/subster_irc.py", line 156, in
main_subster * bot.run() * File "/home/drtrigon/pywikipedia/subster.py", line 220, in run * self.save(page, substed_content, head + mod % (", ".join(substed_tags)), **flags) * File "/home/drtrigon/pywikipedia/dtbext/dtbext_basic.py", line 240, in save * page.put(text, comment=comment, minorEdit=minorEdit, botflag=botflag) * File "/home/drtrigon/pywikipedia/wikipedia.py", line 1708, in put * sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = sysop) * File "/home/drtrigon/pywikipedia/wikipedia.py", line 1581, in _getActionUser * self.site().forceLogin(sysop = sysop) * File "/home/drtrigon/pywikipedia/wikipedia.py", line 5008, in forceLogin * if loginMan.login(retry = True): * File "/home/drtrigon/pywikipedia/login.py", line 307, in login * password = True) * File "/home/drtrigon/pywikipedia/wikipedia.py", line 8018, in input * data = ui.input(question, password) * File "/home/drtrigon/pywikipedia/userinterfaces/terminal_interface.py", line 238, in input * text = getpass.getpass('') * File "/opt/ts/python/2.7/lib/python2.7/getpass.py", line 83, in unix_getpass * passwd = fallback_getpass(prompt, stream) * File "/opt/ts/python/2.7/lib/python2.7/getpass.py", line 118, in fallback_getpass * return _raw_input(prompt, stream) * File "/opt/ts/python/2.7/lib/python2.7/getpass.py", line 135, in _raw_input * raise EOFError * EOFError
...any idea whats happening here??
Thanks a lot! Greetings DrTrigon
_______________________________________________ Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
_______________________________________________ Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l