Bug 1280034 - dnf fails if stdin (fd 0) is not open: AttributeError: 'NoneType' object has no attribute 'isatty'
Summary: dnf fails if stdin (fd 0) is not open: AttributeError: 'NoneType' object has ...
Keywords:
Status: CLOSED DUPLICATE of bug 1278382
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-10 19:25 UTC by Richard W.M. Jones
Modified: 2015-11-11 12:27 UTC (History)
12 users (show)

Fixed In Version:
Clone Of: 1280029
Environment:
Last Closed: 2015-11-10 20:27:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2015-11-10 19:25:22 UTC
Running `dnf -y update --best` when stdin (fd 0) is not open
gives this error:

    [. . .]
    Delta RPMs reduced 93.7 MB of updates to 54.7 MB (41.1% saved)
    warning: /var/cache/dnf/updates-e042e478e0621ea6/packages/kernel-4.2.5-300.fc23.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 34ec9cba: NOKEY
    The downloaded packages were saved in cache till the next successful transaction.
    You can remove cached packages by executing 'dnf clean packages'.
    Traceback (most recent call last):
      File "/bin/dnf", line 35, in <module>
        main.user_main(sys.argv[1:], exit_code=True)
      File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 198, in user_main
        errcode = main(args)
      File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 84, in main
        return _main(base, args)
      File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 144, in _main
        ret = resolving(cli, base)
      File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 173, in resolving
        base.do_transaction(display=displays)
      File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 220, in do_transaction
        self.gpgsigcheck(downloadpkgs)
      File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 251, in gpgsigcheck
        if not sys.stdin.isatty() and not ay:
    AttributeError: 'NoneType' object has no attribute 'isatty'

I believe the version of dnf is:

dnf-1.1.3-1.fc23.noarch

Comment 1 Richard W.M. Jones 2015-11-10 19:32:34 UTC
I should say that the reason that stdin is not connected to anything
is a bug in libguestfs (see bug 1280029).  But I still think this
is also a bug in dnf because it should do something like:

if (sys.stdin and not sys.stdin.isatty ()) and not ay:
  [etc]

Comment 2 Richard W.M. Jones 2015-11-10 20:27:28 UTC
Looks like James already filed the dnf bug.

*** This bug has been marked as a duplicate of bug 1278382 ***


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