Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOError: Please specify user or filename to write. #2

Closed
ophirpeleg opened this issue Aug 5, 2016 · 3 comments
Closed

IOError: Please specify user or filename to write. #2

ophirpeleg opened this issue Aug 5, 2016 · 3 comments

Comments

@ophirpeleg
Copy link

Hey,
The program works well until I try to set an alarm.
It said that I need specify user of filename to write, how do I fix this issue?
a BIG thanks!

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/pi_alarm_env/pi_alarm/app/controller.py", line 51, in set_alarm
    scheduler.schedule_alarm(weekday, hour, minute)
  File "/opt/pi_alarm_env/pi_alarm/app/scheduler.py", line 79, in schedule_alarm
    self.cron.write()
  File "/usr/local/lib/python2.7/dist-packages/crontab.py", line 311, in write
    raise IOError("Please specify user or filename to
``` write.")
IOError: Please specify user or filename to write.
@ajpierce
Copy link
Owner

ajpierce commented Aug 5, 2016

Hi! Thanks for your interest, and I'm sorry about the bug.

I ran a pip freeze on my local environment here, and it looks like the version of crontab i'm running is python-crontab==1.7.2. I wonder if, because I haven't tried updating the software in two years, this is the cause of the problem?

In the short term, change which version of python-crontab you install (in the setup.sh file), and I will look at modifying the code to work with the latest version 👍

@ajpierce
Copy link
Owner

ajpierce commented Aug 5, 2016

Ok, I am able to recreate this issue by upgrading my version of python-crontab to the latest. Fix incoming shortly

@ajpierce
Copy link
Owner

ajpierce commented Aug 5, 2016

Thanks for reporting this! The bug should now be resolved in commit 7acad1d

@ajpierce ajpierce closed this as completed Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants