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

Squigly brackets in filename cause an error #22

Open
Chaiavi opened this issue Aug 13, 2021 · 5 comments
Open

Squigly brackets in filename cause an error #22

Chaiavi opened this issue Aug 13, 2021 · 5 comments

Comments

@Chaiavi
Copy link

Chaiavi commented Aug 13, 2021

When having a file with a squigly bracket in the filename "{" or "}", an error is raised:

DirectoryPaneListener 'StatusBarExtended' raised error.

Traceback (most recent call last):
  File "fman\impl\plugins\plugin.py", line 311, in _notify_listener_in_thread
  File "C:\Users\ahayun\AppData\Roaming\fman\Plugins\Third-party\StatusBarExtended\statusbarextended\__init__.py", line 144, in on_path_changed
    StatusBarExtended.refresh(self)
  File "C:\Users\ahayun\AppData\Roaming\fman\Plugins\Third-party\StatusBarExtended\statusbarextended\__init__.py", line 33, in refresh
    dir_files_in_dir      = glob.glob(current_dir + "/*")
  File "glob.py", line 20, in glob
  File "glob.py", line 71, in _iglob
  File "glob.py", line 72, in _iglob
  File "glob.py", line 83, in _glob1
  File "fnmatch.py", line 52, in filter
  File "fnmatch.py", line 46, in _compile_pattern
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\re.py", line 233, in compile
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\re.py", line 301, in _compile
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_compile.py", line 562, in compile
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 855, in parse
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 416, in _parse_sub
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 765, in _parse
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 416, in _parse_sub
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 553, in _parse
sre_constants.error: bad character range 2-0 at position 20
@eugenesvk
Copy link
Contributor

Interesting, I don't have any issue with {} on Windows with fman 1.7.3
sbe-squiggly

Could you maybe share more details: full path name, fman version, full plugin settings file StatusBarExtended (Windows).json etc.
Also, are you able to execute the same path + "/*" glob in a regular python session?

@eugenesvk
Copy link
Contributor

you might have [] brackets with some extra symbols in the path name (not in the file name), seems like a known glob design limitation (https://bugs.python.org/issue738361), e.g. this [A--_B] crashes glob (and this plugin) on both Windows and macOS

eugenesvk added a commit to eugenesvk/StatusBarExtendedF that referenced this issue Aug 14, 2021
@eugenesvk
Copy link
Contributor

eugenesvk commented Aug 14, 2021

You might want to use this updated plugin version as a temporary fix before it's merged to the new release — I think I've escaped all the glob meta chars https://docs.python.org/3/library/glob.html properly, so it shouldn't crash or anything, but any additional testing is appreciated

eugenesvk added a commit to eugenesvk/StatusBarExtendedF that referenced this issue Aug 14, 2021
Escape meta-characters `*` `?` `[` `]` by [bracketing them]

Fixes: kek91#22
eugenesvk added a commit to eugenesvk/StatusBarExtendedF that referenced this issue Aug 14, 2021
Escape meta-characters * ? [ ] by [bracketing them]

Fixes: kek91#22
@Chaiavi
Copy link
Author

Chaiavi commented Aug 14, 2021

Uninstalled the previous version, then installed the plugin (all within fman)

But got the following error:

Traceback (most recent call last):
  File "urllib\request.py", line 1318, in do_open
  File "http\client.py", line 1239, in request
  File "http\client.py", line 1285, in _send_request
  File "http\client.py", line 1234, in endheaders
  File "http\client.py", line 1026, in _send_output
  File "http\client.py", line 964, in send
  File "http\client.py", line 1392, in connect
  File "http\client.py", line 936, in connect
  File "socket.py", line 704, in create_connection
  File "socket.py", line 745, in getaddrinfo
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\ahayun\AppData\Local\fman\Versions\1.7.3\Plugins\Core\core\github.py", line 76, in _get
    return urlopen(url).read()
  File "urllib\request.py", line 223, in urlopen
  File "urllib\request.py", line 532, in open
  File "urllib\request.py", line 642, in http_response
  File "urllib\request.py", line 564, in error
  File "urllib\request.py", line 504, in _call_chain
  File "urllib\request.py", line 756, in http_error_302
  File "urllib\request.py", line 526, in open
  File "urllib\request.py", line 544, in _open
  File "urllib\request.py", line 504, in _call_chain
  File "urllib\request.py", line 1361, in https_open
  File "urllib\request.py", line 1320, in do_open
urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "lib\site-packages\urllib3\connection.py", line 159, in _new_conn
  File "lib\site-packages\urllib3\util\connection.py", line 57, in create_connection
  File "socket.py", line 745, in getaddrinfo
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
  File "lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
  File "lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn```

@Chaiavi
Copy link
Author

Chaiavi commented Aug 14, 2021

Never mind, probably a fluke

It now succeeded installing it

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