Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: can't use a string pattern on a bytes-like object #18

Closed
delor opened this issue Jun 19, 2013 · 3 comments
Closed

TypeError: can't use a string pattern on a bytes-like object #18

delor opened this issue Jun 19, 2013 · 3 comments

Comments

@delor
Copy link

delor commented Jun 19, 2013

system: Arch Linux 3.9.6-1 x86_64
Python version: 3.3.2
pidcat version: f624fe4

Traceback (most recent call last):
  File ".bin/pidcat.py", line 173, in <module>
    bug_line = BUG_LINE.match(line)
TypeError: can't use a string pattern on a bytes-like object
@JakeWharton
Copy link
Owner

Repro'd on my Mac. Must be a change in how subprocess reports data in Python 3.

@JakeWharton
Copy link
Owner

Should be fixed. Please try.

I'm working on setting up a test suite using a fake binary so prevent things like this moving forwrd.

tomrozb pushed a commit to tomrozb/pidcat that referenced this issue Jul 12, 2014
@bj0
Copy link

bj0 commented Sep 19, 2017

You also can't mix bytes and string objects in regex, so line 66 throws the same exception.

Also, why do you .encode the output before you print it? For me that prevents the output from printing correctly, it looks like this:

b'\x1b[33m PeopleDataManager\x1b[0m \x1b[30;102m I \x1b[0m removeNotification'

I'm using Python 3.6, and removing the encode part of line 360 makes it print correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants