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

Windows上でコマンドとして実行したとき、NotImplementedError が発生する #378

Open
seroqn opened this issue Jan 9, 2022 · 1 comment

Comments

@seroqn
Copy link

seroqn commented Jan 9, 2022

Windows10, python は Windows版3.10.1
(sccopで入れたpythonと、pipxで入れたvintを使用)

コマンドプロンプトからでもmsys2上のzshからの実行でも変わらず発生する

%  vint plugin/guide.vim
Traceback (most recent call last):
  File "C:\Users\YukiHiro\scoop\apps\python\current\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\YukiHiro\scoop\apps\python\current\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\hom\.dt\.pipx\bin\vint.exe\__main__.py", line 7, in <module>
  File "D:\hom\.dt\.pipx\pipx\venvs\vim-vint\lib\site-packages\vint\__init__.py", line 11, in main
    init_cli()
  File "D:\hom\.dt\.pipx\pipx\venvs\vim-vint\lib\site-packages\vint\bootstrap.py", line 22, in init_cli
    cli.start()
  File "D:\hom\.dt\.pipx\pipx\venvs\vim-vint\lib\site-packages\vint\linting\cli.py", line 22, in start
    self._validate(env)
  File "D:\hom\.dt\.pipx\pipx\venvs\vim-vint\lib\site-packages\vint\linting\cli.py", line 47, in _validate
    if not self._should_read_from_stdin(env):
  File "D:\hom\.dt\.pipx\pipx\venvs\vim-vint\lib\site-packages\vint\linting\cli.py", line 129, in _should_read_from_stdin
    return len(env['file_paths']) == 1 and PosixPath('-') in env['file_paths']
  File "C:\Users\YukiHiro\scoop\apps\python\current\lib\pathlib.py", line 960, in __new__
    raise NotImplementedError("cannot instantiate %r on your system"
NotImplementedError: cannot instantiate 'PosixPath' on your system
@BlameTroi
Copy link

i get this as well. i don't know enough about python packaging to test this, but from the documentation and looking at the code, changing the import in cli.py to use Path or PurePath instead of PosixPath from pathlib, and PosixPath('-') to whichever is imported seems like a good first step.

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

2 participants