crontab -l error msgs are printed on screen, if no previous crontab file exists for user

Bug #1178167 reported by Roy Rothenberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-crontab
Fix Released
Low
Martin Owens

Bug Description

On Linux and Solaris (and perhaps other platforms as well), when creating a cron for a user which previously had no crontab file, a text is written to stderr, and therefore to screen/console.

For example, in linux the message is:

no crontab for root

The solution is probably to replace the line in the Crontab.read method:
p = sp.Popen(self._read_execute(), stdout=sp.PIPE)

With the line:
p = sp.Popen(self._read_execute(), stdout=sp.PIPE, stderr=sp.PIPE)

And then the msg isn't displayed on screen (unless you choose to display it).

I tried this on a local copy, and it works perfectly.

Revision history for this message
Roy Rothenberg (royrothenberg) wrote :

To be clear - AFAIK this is not a regression, and is consistent with the module's behaviour in previous versions.

Martin Owens (doctormo)
Changed in python-crontab:
importance: Undecided → Low
assignee: nobody → Martin Owens (doctormo)
status: New → Fix Committed
Revision history for this message
Roy Rothenberg (royrothenberg) wrote :

Thanks!

Martin Owens (doctormo)
Changed in python-crontab:
status: Fix Committed → Fix Released
Martin Owens (doctormo)
Changed in python-crontab:
milestone: none → 1.3
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.