comments incorrectly parsed as commands

Bug #1638533 reported by Vasili
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-crontab
Fix Committed
Low
Martin Owens

Bug Description

Minimal test case:

>>> cron=CronTab(tab="# * * * * * hello")
>>> for c in cron.commands:
... print c
...
hello

Expected: cron.commands to be empty.

Revision history for this message
Martin Owens (doctormo) wrote :

It's parsed as a disabled command. You should see an enabled flag set to false and when you do `print cron` you should get back the commented version.

It works this way so developers can enable and disable commands without having to manually go into the comments.

Should commands only return enabled commands?

Revision history for this message
Vasili (3point2) wrote :

My expectation would be to not get commented commands, but your use case also makes sense. I should have read the examples more carefully. You can go ahead and close this if you like, thanks.

Revision history for this message
Martin Owens (doctormo) wrote :

I added an extra bit to the readme for clarity. But otherwise this report is now closed.

Thanks Vasili

Changed in python-crontab:
status: New → Fix Committed
milestone: none → 2.2
assignee: nobody → Martin Owens (doctormo)
importance: Undecided → Low
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.