parted errors printed to standard output

Bug #337572 reported by billbear
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Parted
New
Unknown
parted (Ubuntu)
Triaged
Low
Unassigned

Bug Description

[Intrepid]
Standard error of parted goes to standard output. This makes my script to function unexpectedly.
Look at the different behavior of parted in hardy and intrepid:

intrepid: (unexpected behavior)
root@ubuntu-desktop:~# parted /dev/ramzswap0 print
错误: /dev/ramzswap0: unrecognised disk label
root@ubuntu-desktop:~# echo $?
1
root@ubuntu-desktop:~# parted /dev/ramzswap0 print 2> /dev/null
错误: /dev/ramzswap0: unrecognised disk label
root@ubuntu-desktop:~# parted /dev/ramzswap0 print > /dev/null
root@ubuntu-desktop:~#
root@ubuntu-desktop:~# parted /dev/1
错误: 无法对设备 /dev/1 - 没有该文件或目录 做 stat 操作。
重试/Retry/放弃/Cancel? c
root@ubuntu-desktop:~# parted -s /dev/1
错误: 无法对设备 /dev/1 - 没有该文件或目录 做 stat 操作。
root@ubuntu-desktop:~# echo $?
1
root@ubuntu-desktop:~# parted -s /dev/1 2> /dev/null
错误: 无法对设备 /dev/1 - 没有该文件或目录 做 stat 操作。
root@ubuntu-desktop:~# parted -s /dev/1 > /dev/null
root@ubuntu-desktop:~#

hardy: (expected behavior)
root@pt-desktop:/home/pt# parted /dev/1
错误: 无法对设备 /dev/1 - 没有该文件或目录 做 stat 操作。
重试/Retry/放弃/Cancel? c
root@pt-desktop:/home/pt# parted -s /dev/1
错误: 无法对设备 /dev/1 - 没有该文件或目录 做 stat 操作。
root@pt-desktop:/home/pt# echo $?
1
root@pt-desktop:/home/pt# parted -s /dev/1 2> /dev/null
root@pt-desktop:/home/pt# parted -s /dev/1 > /dev/null
错误: 无法对设备 /dev/1 - 没有该文件或目录 做 stat 操作。
root@pt-desktop:/home/pt#

Revision history for this message
Michael McKinley (m-mckinley) wrote :

I can confirm this on Jaunty, running parted 1.8.8. I've reported the bug upstream.

Changed in parted:
status: New → Confirmed
Changed in parted:
status: Unknown → New
Revision history for this message
Colin Watson (cjwatson) wrote :

While this is certainly a bug (because it can cause errors to fail to be logged properly), scripts should generally look at the exit code rather than attempting to parse stdout or stderr.

Changed in parted (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
summary: - Intrepid: standard error of parted goes to standard output
+ parted errors printed to standard output
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.