Hello Konstantinos,

Is this with compat or core? On tool labs, using the shared framework, I can run login.py twice, and I'm logged in the second time.

In any case, you can prevent any questions for passwords by using a password_file:

# By default you are asked for a password on the terminal.
# A password file may be used. e.g. password_file = ".passwd"
# The password file should consist of lines containing
# Python tuples of any of the following formats:
# (code, family, username, password)
# (family, username, password)
# (username, password)
password_file = None


create a password file with

("myusername", "mypassword")

and add the following line to your user-config.py:

password_file = "name of the password file"


Instead of asking for the password, the bot will then just use the password provided there.


This is a good idea for cron jobs in any case, because (if I remember correctly) cookies on WMF servers only have a lifespan of a month, so even without the issue you describe you'd have to log in every month or so.


Hope this helps,
Merlijn




2014-08-30 10:41 GMT+02:00 Konstantinos Stampoulis <geraki@geraki.gr>:
Hi,
I have used pywiki(pedia)bot for years and I had many bots running [from my machines (Ubuntu and Windows 7) and the toolserver: same behaviour].
Since many months (a year?) pywikibot *always* asks for password even if I have just logged in (with previous run of a script or login.py). That means that I cannot schedule bots with cron or run them with batch files etc.
I did not have time to bother for bots running under schedule but it is time to see what can be done. So: how can I fix it?


Konstantinos Stampoulis
geraki@geraki.gr
http://www.geraki.gr

----
Συνεισφέρετε στην Βικιπαίδεια. https://el.wikipedia.org
Φτιάξτε λογαριασμό στο Dropbox:  https://db.tt/G0jOavL
-----------------------------------------------------------------------
Οι παραπάνω απόψεις είναι προσωπικές και δεν εκφράζουν παρά μόνο εμένα. Το μήνυμα θεωρείται εμπιστευτικό μόνο εάν το έχω ζητήσει ρητά, διαφορετικά μπορείτε να το χρησιμοποιήσετε σε οποιαδήποτε δημόσια συζήτηση. Δεν έχω τίποτε να κρύψω. :-)


_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l