nschloe / termplotlib

:chart_with_upwards_trend: Plotting on the command line
GNU General Public License v3.0
675 stars 19 forks source link

Wrong output in get_gnuplot_version #79

Open carlosal1015 opened 1 year ago

carlosal1015 commented 1 year ago

Hi, this test

ERROR tests/test_plot.py - RuntimeError: Couldn't get gnuplot version

is failing because

Python 3.11.5 (main, Sep  2 2023, 14:16:33) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import termplotlib as tpl
>>> tpl.get_gnuplot_version()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/makepkg/python-termplotlib/src/termplotlib-0.3.9/src/termplotlib/helpers.py", line 38, in get_gnuplot_version
    raise RuntimeError("Couldn't get gnuplot version")
RuntimeError: Couldn't get gnuplot version
>>> import subprocess
>>> subprocess.check_output(["gnuplot", "--version"]).decode()
'gnuplot 5.4 patchlevel 10\n'
>>> out = subprocess.check_output(["gnuplot", "--version"]).decode()
>>> out
'gnuplot 5.4 patchlevel 10\n'
>>> import re
>>> re.match("gnuplot (\\d).(\\d) patchlevel (\\d)\n", out)
>>>