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: cannot use a string pattern on a bytes-like object #21

Open
3isenHeiM opened this issue Dec 2, 2022 · 3 comments
Open

TypeError: cannot use a string pattern on a bytes-like object #21

3isenHeiM opened this issue Dec 2, 2022 · 3 comments

Comments

@3isenHeiM
Copy link

I'm getting this error when launching the script (python 2.7 or python 3.9).

Traceback (most recent call last):
  File "/home/XXX/GitHub/tomcatWarDeployer/tomcatWarDeployer.py", line 1224, in <module>
    main()
  File "/home/XXX/GitHub/tomcatWarDeployer/tomcatWarDeployer.py", line 1063, in main
    browser, url = browseToManager(
  File "/home/XXX/GitHub/tomcatWarDeployer/tomcatWarDeployer.py", line 863, in browseToManager
    m = re.search('Apache Tomcat/([^<]+)', data)
  File "/usr/lib/python3.9/re.py", line 201, in search
    return _compile(pattern, flags).search(string)
TypeError: cannot use a string pattern on a bytes-like object

What can I do to solve it ?

@ClubMontana
Copy link

problem is that your regex is a string but html is bytes, either decode the bytes to a string or use a bytes regex

@Itrekr
Copy link

Itrekr commented Sep 8, 2023

Added a request to fix this in the code: #22

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