Comments must be placed on a line of their own

Bug #1506065 reported by Saj Goonatilleke
6
This bug affects 1 person
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.
    (InteractiveConsole)
    >>> import crontab
    >>> tab = crontab.CronTab(tab="", user=False)
    >>> job = tab.new(command="some-job", comment="This is not a valid comment.", user="root")
    >>> 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.

Martin Owens (doctormo)
Changed in python-crontab:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Martin Owens (doctormo) wrote :

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.

Martin Owens (doctormo)
Changed in python-crontab:
importance: High → Medium
status: Confirmed → Fix Committed
milestone: none → 2.0
importance: Medium → High
assignee: nobody → Martin Owens (doctormo)
Martin Owens (doctormo)
Changed in python-crontab:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.