using for with remove skips a job
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-crontab |
Fix Released
|
Medium
|
Martin Owens |
Bug Description
for job in cron:
print (job)
cron.
cron.write()
This method removes every other job.
Starting crontab
1 1 * * * /usr/bin/echo # comment1
1 2 * * * /usr/bin/echo # comment2
1 3 * * * /usr/bin/echo # comment3
1 4 * * * /usr/bin/echo # comment4
1 5 * * * /usr/bin/echo # comment5
1 6 * * * /usr/bin/echo # comment6
1 7 * * * /usr/bin/echo # comment7
1 8 * * * /usr/bin/echo # comment8
1 9 * * * /usr/bin/echo # comment9
1 10 * * * /usr/bin/echo # comment10
output
1 1 * * * /usr/bin/echo # comment1
1 3 * * * /usr/bin/echo # comment3
1 5 * * * /usr/bin/echo # comment5
1 7 * * * /usr/bin/echo # comment7
1 9 * * * /usr/bin/echo # comment9
crontab after
1 2 * * * /usr/bin/echo # comment2
1 4 * * * /usr/bin/echo # comment4
1 6 * * * /usr/bin/echo # comment6
1 8 * * * /usr/bin/echo # comment8
1 10 * * * /usr/bin/echo # comment10
Changed in python-crontab: | |
status: | Fix Committed → Fix Released |
I've committed a fix for the issue as well as a test that failed before and doesn't now.