Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debconf module fails on Python 3 #46299

Closed
gclinch opened this issue Mar 2, 2018 · 0 comments · Fixed by #46300
Closed

debconf module fails on Python 3 #46299

gclinch opened this issue Mar 2, 2018 · 0 comments · Fixed by #46300
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P2 Priority 2 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@gclinch
Copy link
Contributor

gclinch commented Mar 2, 2018

Description of Issue/Question

debconfmod.set under Python 3 fails with TypeError: a bytes-like object is required, not 'str', because a string (and not bytes) is passed to os.write.

Steps to Reproduce Issue

# salt-call -l debug debconf.set testpkg question string value
[...]
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded debconf.set

Passed invalid arguments: a bytes-like object is required, not 'str'.

Usage:

    Set answers to debconf questions for a package.

    CLI Example:

    .. code-block:: bash

        salt '*' debconf.set <package> <question> <type> <value> [<value> ...]
    
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/cli/caller.py", line 204, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/modules/debconfmod.py", line 130, in set_
    os.write(fd_, line)
TypeError: a bytes-like object is required, not 'str'

Versions Report

# salt-call --versions-report
Salt Version:
           Salt: 2017.7.3
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.4
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.4+ (default, Feb 12 2018, 08:25:03)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.3
 
System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-10-generic
         system: Linux
        version: Ubuntu 18.04 bionic
@garethgreenaway garethgreenaway added this to the Approved milestone Mar 2, 2018
@garethgreenaway garethgreenaway added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around fixed-pls-verify fix is linked, bug author to confirm fix P2 Priority 2 labels Mar 2, 2018
rallytime pushed a commit that referenced this issue Mar 5, 2018
Python 3 support for debconfmod (fixes #46299)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P2 Priority 2 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants