vuolter / autoupgrade

Automatic upgrade of PyPI packages from within Python scripts
https://pypi.python.org/pypi/autoupgrade-ng
MIT License
3 stars 9 forks source link

Python 3.6 support #3

Open jm66 opened 6 years ago

jm66 commented 6 years ago

autoupgrade-ng==0.3.0 error on python Python 3.6.4:

  File ".../lib/python3.6/site-packages/autoupgrade/package.py", line 139, in _get_highest_version
    re.findall(pattr, html.read(), flags=re.I))
  File ".../lib/python3.6/re.py", line 222, in findall
    return _compile(pattern, flags).findall(string)
TypeError: cannot use a string pattern on a bytes-like object
jm66 commented 6 years ago

hey @vuolter any update on this?

amorozkin commented 3 years ago

This made it work for me:

/usr/local/lib/python3.6/site-packages/autoupgrade/package.py
139c139
<                        re.findall(pattr, html.read().decode('utf-8'), flags=re.I))
---
>                        re.findall(pattr, html.read(), flags=re.I))