jaraco / cmdix

Fork of https://launchpad.net/pycoreutils
MIT License
27 stars 1 forks source link

Error in ls when glob resolves to a file #16

Closed jaraco closed 5 months ago

jaraco commented 5 months ago

In a directory containing a file ending in exe:

 ~ [1] # ls *.exe
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:\Users\jaraco\.local\bin\ls.exe\__main__.py", line 7, in <module>
  File "C:\Users\jaraco\AppData\Local\pipx\pipx\venvs\cmdix\Lib\site-packages\cmdix\__init__.py", line 127, in run
    return run_subcommand(commandname, argv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jaraco\AppData\Local\pipx\pipx\venvs\cmdix\Lib\site-packages\cmdix\__init__.py", line 165, in run_subcommand    
    args.func(args)
  File "C:\Users\jaraco\AppData\Local\pipx\pipx\venvs\cmdix\Lib\site-packages\cmdix\command\ls.py", line 47, in func
    dirlist = os.listdir(arg)
              ^^^^^^^^^^^^^^^
NotADirectoryError: [WinError 267] The directory name is invalid: 'rustup-gc-d473b855.exe'