]> granicus.if.org Git - graphviz/commit
fix 'dot' test helper failing to encode string input
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 8 Feb 2022 04:15:27 +0000 (15:15 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 12 Feb 2022 20:02:02 +0000 (07:02 +1100)
commit0f12eac348eeff0e8c9b7379ebaee2b65a2b840a
tree7aa5d4a0be216b36f729013d12ac53dc8bce6a65
parent4668a74b4b61dcaa9de91e5f8bda0a9e4f81776a
fix 'dot' test helper failing to encode string input

When asking the `dot` helper function to process a graph from inline input to a
binary output format, the `universal_newlines=True` parameter would not be
passed to the underlying `subprocess.check_output` call, resulting in failure to
encode the input. That is, something like the following:

  dot("png:gd", source="digraph { a -> b; }")

would result in:

  self = <subprocess.Popen object at 0x7fbb862ae390>
      def _communicate(self, input, endtime, orig_timeout):
  …
  >           input_view = memoryview(self._input)
  E           TypeError: memoryview: a bytes-like object is required, not 'str'
  /usr/lib64/python3.6/subprocess.py:1519: TypeError

Note that this problem was latent, as no usage fitting the above scenario
currently exists. Something like this will be introduced in a future commit.

Gitlab: related to #1786
rtest/gvtest.py