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

Catch fs.opener.errors.UnsupportedProtocol #360

Closed
jayvdb opened this issue Dec 30, 2019 · 1 comment
Closed

Catch fs.opener.errors.UnsupportedProtocol #360

jayvdb opened this issue Dec 30, 2019 · 1 comment

Comments

@jayvdb
Copy link
Member

jayvdb commented Dec 30, 2019

Because of moremoban/gitfs2#7 and moremoban/pypifs#6 , those packages are not yet in openSUSE , but the main moban was upgraded to the latest, and the result when those openers are needed:

> python3 -m moban
Traceback (most recent call last):
  File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.7/site-packages/moban/__main__.py", line 4, in <module>
    main()
  File "/usr/lib/python3.7/site-packages/moban/main.py", line 56, in main
    count = handle_moban_file(moban_file, options)
  File "/usr/lib/python3.7/site-packages/moban/main.py", line 191, in handle_moban_file
    mobanfile.handle_moban_file_v1(moban_file_configurations, options)
  File "/usr/lib/python3.7/site-packages/moban/mobanfile/__init__.py", line 62, in handle_moban_file_v1
    merged_options[constants.LABEL_TMPL_DIRS]
  File "/usr/lib/python3.7/site-packages/moban/utils.py", line 29, in verify_the_existence_of_directories
    if file_system.exists(directory):
  File "/usr/lib/python3.7/site-packages/moban/file_system.py", line 36, in wrapper
    return function_in_this_module(*args, **kwds)
  File "/usr/lib/python3.7/site-packages/moban/file_system.py", line 164, in exists
    with fs.open_fs(dir_name) as the_fs:
  File "/usr/lib/python3.7/site-packages/fs/opener/registry.py", line 226, in open_fs
    default_protocol=default_protocol,
  File "/usr/lib/python3.7/site-packages/fs/opener/registry.py", line 185, in open
    opener = self.get_opener(protocol)
  File "/usr/lib/python3.7/site-packages/fs/opener/registry.py", line 128, in get_opener
    "protocol '{}' is not supported".format(protocol)
fs.opener.errors.UnsupportedProtocol: protocol 'git' is not supported

This should be handled more gracefully, and IMO they should be optional dependencies again as moban core doesnt need them.

@chfw
Copy link
Member

chfw commented Dec 30, 2019

Yes, agree with you.

Compulsory dependency was introduced when we started 0.6.x, because 0.5.x had all. That why I have listed as a package dependency.

Starting with 0.7.x, Both should be dropped in package requirements.

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