Bug 1280034 - dnf fails if stdin (fd 0) is not open: AttributeError: 'NoneType' object has no attribute 'isatty'
dnf fails if stdin (fd 0) is not open: AttributeError: 'NoneType' object has ...
Status: CLOSED DUPLICATE of bug 1278382
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-11-10 14:25 EST by Richard W.M. Jones
Modified: 2015-11-11 07:27 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1280029
Last Closed: 2015-11-10 15:27:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2015-11-10 14:25:22 EST
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
      File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 220, in do_transaction
      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:

Comment 1 Richard W.M. Jones 2015-11-10 14:32:34 EST
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:
Comment 2 Richard W.M. Jones 2015-11-10 15:27:28 EST
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.