Comments must be placed on a line of their own
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-crontab |
Fix Released
|
High
|
Martin Owens |
Bug Description
Vixie cron has this to say -- from crontab(5):
Blank lines and leading spaces and tabs are ignored. Lines whose first non-space character is a hash-sign (#) are comments, and are ignored. Note that comments are not allowed on the same line as cron commands, since they will be taken to be part of the command. Similarly, comments are not allowed on the same line as environment variable settings.
python-crontab emits comments inline with its jobs:
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(Interactiv
>>> import crontab
>>> tab = crontab.
>>> job = tab.new(
>>> tab.render()
u'\n* * * * * root some-job # This is not a valid comment.\n'
These comments should be moved to a line of their own. Perhaps something like this:
# This is a valid comment.
* * * * * root some-job
# This is another valid comment.
* * * * * root some-other-job
See also: bug #1336281.
Changed in python-crontab: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in python-crontab: | |
importance: | High → Medium |
status: | Confirmed → Fix Committed |
milestone: | none → 2.0 |
importance: | Medium → High |
assignee: | nobody → Martin Owens (doctormo) |
Changed in python-crontab: | |
status: | Fix Committed → Fix Released |
The linux cron (ubuntu 14.04) does comment out end line comments. These elements aren't passed in.
But this doesn't mean the vixie cron shouldn't be properly supported.