trentm / eol

a command-line script and Python module for working with text file end-of-line (EOL) characters
Other
17 stars 2 forks source link

cannot use a string pattern on a bytes-like object #5

Open Kirill opened 1 year ago

Kirill commented 1 year ago
eol: debug: action: 'convert'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\eol.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\eol.py", line 751, in main
    convert_path_eol(path, eol)
  File "C:\Python311\Lib\site-packages\eol.py", line 295, in convert_path_eol
    converted = convert_text_eol(original, eol)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\eol.py", line 278, in convert_text_eol
    return re.sub('\r\n|\r|\n', eol, text)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\re\__init__.py", line 185, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot use a string pattern on a bytes-like object

version: 0.7.5 eol -q -r -c unix * Files in UTF-8, with non english characters.

kiuber commented 1 month ago

0.7.6 version not release yet, use pip install git+https://github.com/trentm/eol.git for install eol.