pg_activity: 3.1.1: TypeError: cannot use a string pattern on a bytes-like object

Hi. The README.md says Python 3.7 and above is supported? I’m using Python 3.8.5, but I’m getting the following error:

Traceback (most recent call last):
  File "/path/to/home/.local/bin/pg_activity", line 8, in <module>
    sys.exit(main())
  File "/path/to/home/.local/lib/python3.8/site-packages/pgactivity/cli.py", line 389, in main
    dataobj = data.pg_connect(
  File "/path/to/home/.local/lib/python3.8/site-packages/pgactivity/data.py", line 518, in pg_connect
    data = Data.pg_connect(
  File "/path/to/home/.local/lib/python3.8/site-packages/pgactivity/data.py", line 107, in pg_connect
    pg_version = pg_get_short_version(pg_get_version(pg_conn))
  File "/path/to/home/.local/lib/python3.8/site-packages/pgactivity/data.py", line 57, in pg_get_short_version
    res = re.match(
  File "/usr1/local/anaconda_py3/miniconda38/lib/python3.8/re.py", line 191, in match
    return _compile(pattern, flags).match(string)
TypeError: cannot use a string pattern on a bytes-like object

> ~/.local/bin/pg_activity --version
pg_activity 3.1.1
> /usr1/local/anaconda_py3/miniconda38/bin/python3 --version
Python 3.8.5

I installed it using the command python3 -m pip install "pg_activity[psycopg]" --user.

Thanks, Ed

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (17 by maintainers)

Commits related to this issue

Most upvoted comments

If I do that with pg_activity, I still get an error, unfortunately:

Yes, I noticed that on my side too yesterday; that’s a broader issue. I’m working on a fix.

Thank you for your patience.

There’s something strange with your Python environment or your locale setup.