Skip to content

Commit

Permalink
acmecape: Fix buffer_size use with pipes.quote()
Browse files Browse the repository at this point in the history
pipes.quote() doesn't like integers:

>>> from pipes import quote
>>> quote(42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/shlex.py", line 282, in quote
    if _find_unsafe(s) is None:
TypeError: expected string or bytes-like object

Convert buffer_size to str when quoting it
  • Loading branch information
Valentin Schneider authored and marcbonnici committed Feb 6, 2019
1 parent c2db6c1 commit 22f2c8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion devlib/instrument/acmecape.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def reset(self, sites=None, kinds=None, channels=None):
params = dict(
iio_capture=self.iio_capture,
host=self.host,
buffer_size=self.buffer_size,
# This must be a string for quote()
buffer_size=str(self.buffer_size),
iio_device=self.iio_device,
outfile=self.raw_data_file
)
Expand Down

0 comments on commit 22f2c8b

Please sign in to comment.