Bug 604030 - [abrt] report-0.15-1.el6: TextIO.py:72:queryChoice:EOFError
[abrt] report-0.15-1.el6: TextIO.py:72:queryChoice:EOFError
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: report (Show other bugs)
6.0
x86_64 Linux
low Severity medium
: rc
: ---
Assigned To: Gavin Romig-Koch
David Kutálek
abrt_hash:bf0dc1a0
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-15 04:39 EDT by David Kutálek
Modified: 2010-11-10 16:29 EST (History)
2 users (show)

See Also:
Fixed In Version: report-0.16-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 16:29:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: backtrace (1012 bytes, text/plain)
2010-06-15 04:40 EDT, David Kutálek
no flags Details

  None (edit)
Description David Kutálek 2010-06-15 04:39:59 EDT
abrt version: 1.1.5
architecture: x86_64
cmdline: /usr/bin/python /usr/bin/report ./dummy-report.txt
component: report
executable: /usr/bin/report
kernel: 2.6.32-33.el6.x86_64
package: report-0.15-1.el6
reason: TextIO.py:72:queryChoice:EOFError
release: Red Hat Enterprise Linux release 6.0 Beta (Santiago)
time: 1276590821
uid: 501

backtrace
-----
TextIO.py:72:queryChoice:EOFError

Traceback (most recent call last):
  File "/usr/bin/report", line 139, in <module>
    app = report.report(signature, io, **optsDict)
  File "/usr/lib64/python2.6/site-packages/report/__init__.py", line 467, in report
    choice = buildChoices(signature, io, config, rptopts)
  File "/usr/lib64/python2.6/site-packages/report/__init__.py", line 442, in buildChoices
    choice = io.queryChoice(_("Where do you want to send this report:"), choices)
  File "/usr/lib64/python2.6/site-packages/report/io/TextIO.py", line 72, in queryChoice
    choice = raw_input("Choice: ")
EOFError

Local variables in innermost frame:
count: 5
msg: 'Where do you want to send this report:'
self: <report.io.TextIO.TextIO instance at 0x193e6c8>
choices: [<report.io.ChoiceValue instance at 0x193e2d8>, <report.io.ChoiceValue instance at 0x1a700e0>, <report.io.ChoiceValue instance at 0x1a70128>, <report.io.ChoiceValue instance at 0x1ad5950>]
each: <report.io.ChoiceValue instance at 0x1ad5950>

comment
-----
There may be a situation when user wants to cancel reporting 
during choice of reporting destination. Report should handle 
Ctrl-D and Ctrl-C nicely and provide also a menuitem to cancel reporting.

How to reproduce
-----
1. Run "report existing-report-file"
2. Hit Ctrl-D
Comment 1 David Kutálek 2010-06-15 04:40:07 EDT
Created attachment 424075 [details]
File: backtrace
Comment 3 RHEL Product and Program Management 2010-06-15 04:53:11 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 4 David Kutálek 2010-06-15 07:58:55 EDT
Same EOFError appears also when Ctrl-D when asking for host.
I suppose it will be the same with other prompts, too.

[root@timothy plugins-basic]# report --path=/tmp --username=dkutalek --target=scp ./dummy-report.txt 

host: Traceback (most recent call last):
  File "/usr/bin/report", line 139, in <module>
    app = report.report(signature, io, **optsDict)
  File "/usr/lib64/python2.6/site-packages/report/__init__.py", line 471, in report
    retval = choice(signature, io)
  File "/usr/lib64/python2.6/site-packages/report/__init__.py", line 394, in <lambda>
    return (lambda module, optionsDict: lambda signature, io : module.report(signature, io, optionsDict))(module, optionsDict)
  File "/usr/lib64/python2.6/site-packages/report/plugins/scp/__init__.py", line 58, in report
    return copyFileToRemote(fileName, io, optionsDict)
  File "/usr/lib64/python2.6/site-packages/report/plugins/scp/__init__.py", line 90, in copyFileToRemote
    host = io.queryField("host")
  File "/usr/lib64/python2.6/site-packages/report/io/TextIO.py", line 61, in queryField
    fieldValue = raw_input("%s: " % fieldName)
EOFError
Comment 5 Gavin Romig-Koch 2010-06-18 11:24:28 EDT
pushed to fedorahosted src repo.

CTRL-D is now noticed by the text input routines if it is the first character in the input field.  It aborts the input of that field, which also ends the program.

Also the 'target' input query for both the command line mode (text) and curses style mode (newt) now both include a specific 'cancel' option.  (The GUI (gtk) mode has had a cancel option for a while now.)

The report library specifically doesn't handle CTRL-C, so that it can be used/handled by the calling program.  The report command line already handles CTRL-C, and ends the program.
Comment 7 Gavin Romig-Koch 2010-06-21 16:24:42 EDT
done
Comment 10 releng-rhel@redhat.com 2010-11-10 16:29:33 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.