Last modified: 2014-11-09 16:15:20 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 T74680, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72680 - '' not found if runs with cron
'' not found if runs with cron
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
All All
: High major
: ---
Assigned To: Pywikipedia bugs
: code-update-regression
: 72918 (view as bug list)
Depends on:
Blocks: pwb20
  Show dependency treegraph
Reported: 2014-10-29 15:58 UTC by Beta16
Modified: 2014-11-09 16:15 UTC (History)
5 users (show)

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


Description Beta16 2014-10-29 15:58:20 UTC
After Ic8ac542919e18ad16458d21e0f9713ade899b964 if I try to run a script via command line (foreground), it's executed correctly.
Eg: python <script_name>
But when I schedule the same script via cron, it terminates with this error:

NOTE: '' was not found!
Please follow the prompts to create it:
Traceback (most recent call last):
  File "/data/project/betabot/core/", line 162, in <module>
  File "/data/project/betabot/core/", line 74, in run_python_file
    source = open(filename).read()
IOError: [Errno 2] No such file or directory: ''

This is my version:
Pywikibot: [https] r-pywikibot-core.git (178e01a, g4377, 2014/10/26, 22:42:22, OUTDATED)
Release version: 2.0b2
httplib2 version: 0.9
    certificate test: ok
Python: 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3]
  unicode test: ok

Please, ask me if you need more information.
Comment 1 John Mark Vandenberg 2014-10-29 16:11:20 UTC
Is your in /data/project/betabot/core/ or in ~/.pywikibot ?
Comment 2 Fabian 2014-10-29 16:16:39 UTC
And do you use PYWIKIBOT2_DIR to define the directory. I'm not so knowledgable with cron, but it might not have PYWIKIBOT2_DIR set.
Comment 3 Beta16 2014-10-29 16:39:09 UTC
(In reply to John Mark Vandenberg from comment #1)
> Is your in /data/project/betabot/core/ or in ~/.pywikibot ?

My file is in /data/project/betabot/core/

(In reply to Fabian from comment #2)
> And do you use PYWIKIBOT2_DIR to define the directory. I'm not so
> knowledgable with cron, but it might not have PYWIKIBOT2_DIR set.

I don't use environment variable PYWIKIBOT2_DIR
Comment 4 Fabian 2014-10-29 19:34:25 UTC
Okay this sounds like cron is not in the directory when it is executing and it chooses the directory depending on where your console is at the moment.

I'm not sure if that is going to be fixed or how.
Comment 5 John Mark Vandenberg 2014-10-31 23:10:18 UTC
This is reported to be a regression.  Need to confirm that, and if so, fix it.
Comment 6 Merlijn van Deen (test) 2014-11-08 22:06:24 UTC
*** Bug 72918 has been marked as a duplicate of this bug. ***
Comment 7 Gerrit Notification Bot 2014-11-08 23:31:21 UTC
Change 172096 had a related patch set uploaded by Mpaa:
Bug 72680 - '' not found if runs with cron
Comment 8 Steinsplitter 2014-11-09 14:10:47 UTC
It breaks all bots with the newest version on toolslabs
Comment 9 Gerrit Notification Bot 2014-11-09 16:12:43 UTC
Change 172096 merged by jenkins-bot:
Bug 72680 - '' not found if runs with cron
Comment 10 Merlijn van Deen (test) 2014-11-09 16:15:13 UTC
As a workaround, chdir to the path before running, or
explicitly define the user-config path with -dir:/path/where/
(or check out an older revision).

As far as I can see, the merged patch fixes this. The behaviour /is/ slightly different from before (the current working dir gets prevalence over the directory) but this is by design.

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