karsten / rpkg

Forked from rpkg 7 years ago
Clone

e0951d9 python3: fix string types

Authored and Committed by Pavel Šimerda 7 years ago
    python3: fix string types
    
    Fix text/binary string issues in pyrpkg.
    
        Could not execute verrel: endswith first arg must be bytes or a tuple of bytes, not str
        Traceback (most recent call last):
          File "/usr/lib/python-exec/python3.4/fedpkg", line 16, in <module>
            main()
          File "/usr/lib64/python3.4/site-packages/fedpkg/__main__.py", line 78, in main
            sys.exit(client.args.command())
          File "/usr/lib64/python3.4/site-packages/pyrpkg/cli.py", line 1295, in verrel
            print('%s-%s-%s' % (self.cmd.module_name, self.cmd.ver,
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 526, in module_name
            self.load_module_name()
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 545, in load_module_name
            if module_name.endswith('.git'):
        TypeError: endswith first arg must be bytes or a tuple of bytes, not str
    
        Could not execute verrel: 'str' does not support the buffer interface
        Traceback (most recent call last):
          File "/usr/lib/python-exec/python3.4/fedpkg", line 16, in <module>
            main()
          File "/usr/lib64/python3.4/site-packages/fedpkg/__main__.py", line 78, in main
            sys.exit(client.args.command())
          File "/usr/lib64/python3.4/site-packages/pyrpkg/cli.py", line 1295, in verrel
            print('%s-%s-%s' % (self.cmd.module_name, self.cmd.ver,
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 808, in ver
            self.load_nameverrel()
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 624, in load_nameverrel
            cmd.extend(self.rpmdefines)
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 687, in rpmdefines
            self.load_rpmdefines()
          File "/usr/lib64/python3.4/site-packages/fedpkg/__init__.py", line 167, in load_rpmdefines
            self.mockconfig = 'fedora-rawhide-%s' % self.localarch
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 493, in localarch
            self.load_localarch()
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 501, in load_localarch
            self._localarch = proc.communicate()[0].strip('\n')
        TypeError: 'str' does not support the buffer interface
    
        Could not execute verrel: endswith first arg must be str or a tuple of str, not bytes
        Traceback (most recent call last):
          File "/usr/lib/python-exec/python3.4/fedpkg", line 16, in <module>
            main()
          File "/usr/lib64/python3.4/site-packages/fedpkg/__main__.py", line 78, in main
            sys.exit(client.args.command())
          File "/usr/lib64/python3.4/site-packages/pyrpkg/cli.py", line 1295, in verrel
            print('%s-%s-%s' % (self.cmd.module_name, self.cmd.ver,
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 526, in module_name
            self.load_module_name()
          File "/usr/lib64/python3.4/site-packages/pyrpkg/__init__.py", line 545, in load_module_name
            if module_name.endswith(b'.git'):
        TypeError: endswith first arg must be str or a tuple of str, not bytes
    
    Related: https://pagure.io/rpkg/issue/45
    Signed-off-by: Pavel Šimerda <pavlix@pavlix.net>
    
        
file modified
+6 -5