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

vint errors on unicode characters #242

Open
li-ruijie opened this issue Sep 22, 2017 · 2 comments
Open

vint errors on unicode characters #242

li-ruijie opened this issue Sep 22, 2017 · 2 comments
Assignees
Labels

Comments

@li-ruijie
Copy link

I was using vint.exe on my vimrc when it kept giving me the following error message:

Traceback (most recent call last):
  File "C:\Env\Python3\Scripts\vint-script.py", line 11, in <module>
    load_entry_point('vim-vint==0.3.14', 'console_scripts', 'vint')()
  File "c:\env\python3\lib\site-packages\vint\__init__.py", line 11, in main
    init_cli()
  File "c:\env\python3\lib\site-packages\vint\bootstrap.py", line 22, in init_cli
    cli.start()
  File "c:\env\python3\lib\site-packages\vint\linting\cli.py", line 27, in start
    violations = self._lint_all(env, config_dict)
  File "c:\env\python3\lib\site-packages\vint\linting\cli.py", line 120, in _lint_all
    violations += linter.lint_file(file_path)
  File "c:\env\python3\lib\site-packages\vint\linting\linter.py", line 106, in lint_file
    root_ast = self._parser.parse_file(path)
  File "c:\env\python3\lib\site-packages\vint\ast\parsing.py", line 58, in parse_file
    decoded = bytes_seq.decode(encoding)
  File "c:\env\python3\lib\encodings\cp1254.py", line 15, in decode
    return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8e in position 2939: character maps to <undefined>

By trial and error, I narrowed it down to the character: 𝒮
When I removed the line containing the character, all is well.

System: Win 10 Pro x64, python36 x64, cmd codepage 65001
Vint was installed using pip.

@Kuniwak Kuniwak self-assigned this Nov 4, 2017
@Kuniwak Kuniwak added the bug label Nov 4, 2017
@Kuniwak
Copy link
Member

Kuniwak commented Nov 4, 2017

Maybe duplicated #225

Kuniwak added a commit that referenced this issue Nov 4, 2017
Kuniwak added a commit that referenced this issue Nov 4, 2017
Kuniwak added a commit that referenced this issue Nov 11, 2017
* WIP

* Make debugging easy for fix encoding bugs

* Fix encoding problem that is #225 #242

* More simple implementation for bytes compatible

* Make more simple

* Remove debugging code

* It is a classmethod, not instance method

* Add a test case for suddn EOF

* Rename to the correct name

* Care multiple scriptencoding

* Fix a problem about debug_hint overwriting

* Care single line scriptencoding

* decoding error is not a RuntimeError but Exception

* More debug_hint

* Fix a problem about missing last char

* Change Chardet priority

* Revert "WIP"

This reverts commit 1fb7dfc.

* Split files

* Try to resolve module name conflict

* Cosmetic changes

* Compose strategies to decoding_strategy
@tyru
Copy link
Collaborator

tyru commented Mar 6, 2020

@li-ruijie it was fixed already.

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

No branches or pull requests

3 participants