4818: "rbt post" fails with TypeError under Python 3.7.3 on Windows 10 x64

c0d3h4x0r

What version are you running?

RBTools==1.0.2

What steps will reproduce the problem?

  1. Install 32-bit Python 3.7.3 on Windows 10 x64.
  2. pip install rbtools==1.0.2
  3. <change into root of Perforce workspace with files opened for "p4 edit">
  4. rbt post default

What is the expected output? What do you see instead?

Expected: it should just work.

Actual:

ERROR: Could not load SCM Client "tfs"
Traceback (most recent call last):
File "c:\python37\lib\site-packages\rbtools\clients__init__.py", line 736, in load_scmclients
client = ep.load()(config=config, options=options)
File "c:\python37\lib\site-packages\rbtools\clients\tfs.py", line 979, in init
none_on_ignored_error=True)
File "c:\python37\lib\site-packages\rbtools\utils\process.py", line 145, in execute
for key, value in six.iteritems(new_env)
File "c:\python37\lib\site-packages\rbtools\utils\process.py", line 145, in <genexpr>
for key, value in six.iteritems(new_env)
TypeError: string argument without an encoding
CRITICAL: string argument without an encoding

What operating system are you using?

Windows 10 Enterprise 64-bit

Attach the debug out from the command.

>>> RBTools 1.0.2
>>> Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
>>> Running on Windows-10-10.0.16299-SP0
>>> Home = C:\Users\kkelly\AppData\Roaming
>>> Current directory = D:\p4\depot\teams\near
>>> Command line: rbt post --debug default
>>> Running: tf vc help
ERROR: Could not load SCM Client "tfs"
Traceback (most recent call last):
  File "c:\python37\lib\site-packages\rbtools\clients\__init__.py", line 736, in load_scmclients
    client = ep.load()(config=config, options=options)
  File "c:\python37\lib\site-packages\rbtools\clients\tfs.py", line 979, in __init__
    none_on_ignored_error=True)
  File "c:\python37\lib\site-packages\rbtools\utils\process.py", line 145, in execute
    for key, value in six.iteritems(new_env)
  File "c:\python37\lib\site-packages\rbtools\utils\process.py", line 145, in <genexpr>
    for key, value in six.iteritems(new_env)
TypeError: string argument without an encoding
>>> Checking for a Bazaar repository...
>>> Unable to execute "bzr help": skipping Bazaar
>>> Checking for a ClearCase repository...
>>> Unable to execute "cleartool help": skipping ClearCase
>>> Checking for a CVS repository...
>>> Unable to execute "cvs": skipping CVS
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
Traceback (most recent call last):
  File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python37\Scripts\rbt.exe\__main__.py", line 9, in <module>
  File "c:\python37\lib\site-packages\rbtools\commands\main.py", line 120, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "c:\python37\lib\site-packages\rbtools\commands\__init__.py", line 725, in run_from_argv
    exit_code = self.main(*args) or 0
  File "c:\python37\lib\site-packages\rbtools\commands\post.py", line 756, in main
    client_name=self.options.repository_type)
  File "c:\python37\lib\site-packages\rbtools\commands\__init__.py", line 754, in initialize_scm_tool
    client_name=client_name)
  File "c:\python37\lib\site-packages\rbtools\clients\__init__.py", line 789, in scan_usable_client
    repository_info = tool.get_repository_info()
  File "c:\python37\lib\site-packages\rbtools\clients\git.py", line 250, in get_repository_info
    ignore_errors=True).rstrip('\n')
  File "c:\python37\lib\site-packages\rbtools\clients\git.py", line 1225, in _execute
    return execute(cmdline, cwd=self._git_toplevel, *args, **kwargs)
  File "c:\python37\lib\site-packages\rbtools\utils\process.py", line 145, in execute
    for key, value in six.iteritems(new_env)
  File "c:\python37\lib\site-packages\rbtools\utils\process.py", line 145, in <genexpr>
    for key, value in six.iteritems(new_env)
TypeError: string argument without an encoding

Please provide any additional information below.

This looks to be a code defect in rbtools. In C:\Python37\lib\site-packages\rbtools\utils\process.py, line 144, change the two usages of "six.binary_type" to "six.text_type" instead, and then this issue is resolved.

david
#1 david

Fixed in release-1.0.x (a32dadb). This will ship in 1.0.3. Thanks!

  • -New
    +Fixed