Bug 226672

Summary: Yum cannot handle indirect or piped args: "EOFError: EOF when reading a line"
Product: [Fedora] Fedora Reporter: Keith G. Robertson-Turner <redhat-bugzilla>
Component: yumAssignee: Jeremy Katz <katzj>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-25 19:11:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Keith G. Robertson-Turner 2007-01-31 21:38:06 UTC
Description of problem:

Yum fails with the following error:

 Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 172, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 388, in doTransaction
    if not self.userconfirm():
  File "/usr/share/yum-cli/output.py", line 115, in userconfirm
    choice = raw_input('Is this ok [y/N]: ')
EOFError: EOF when reading a line

Command called:

Many examples:

echo "gphoto2" | awk '{print "sudo yum remove "$0}' | /bin/sh

echo "wine" | xargs sudo yum remove

Etc.

Using the "-y" flag circumvents the above condition (but is not ideal).

Version-Release number of selected component (if applicable):

yum-3.0.3-1.fc6

How reproducible:

Always.

Steps to Reproduce:
1. Call yum with indirect args
2.
3.
  
Actual results:

EOFError: EOF when reading a line

Expected results:

Should parse the args correctly.

Additional info:

This makes writing scripts for yum a real pain.

Also, this is not really a new bug. I've noticed this behaviour before, but
never got around to reporting it.

Comment 1 Jeremy Katz 2007-04-25 19:11:24 UTC
This is the expected behavior, though; with the CLI, we ask if things are okay.
 If you don't want to be asked (in cases like this), then you should pass -y

Comment 2 Keith G. Robertson-Turner 2007-04-26 02:04:10 UTC
Yes but surely "EOFError: EOF when reading a line" is not "expected behaviour",
it's an error condition? Note, this is not just a warning message, it does
actually cause yum to fail.

I can confirm this bug is still in yum-3.0.5-2.fc6.x86_64, I just tried it.

+1 reopen this bug.