ManimCommunity / manim_editor

Web Presenter for Mathematical Animations using Manim.
https://docs.editor.manim.community
MIT License
257 stars 12 forks source link

random error #83

Closed huncut2016 closed 2 years ago

huncut2016 commented 2 years ago

When I wanted to create a new project, I get this output: PermissionError: [Errno 13] Permission denied: '.PlayOnLinux/wineprefix/Office2013/dosdevices/z:/dev/vboxusb' or this : PermissionError: [Errno 13] Permission denied: '.wine/dosdevices/z:/dev/vboxusb'

full error:

ERROR:manim_editor.app:Exception on /create_project2 [POST]
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/app/main/routes.py", line 105, in scene_selection
    scenes = get_scenes()
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/editor/manim_loader.py", line 50, in get_scenes
    for root, _, files in walk(Path("."), get_config().RECURSION_DEPTH):
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/editor/commands.py", line 43, in walk
    for res in walk(top / name, maxdepth - 1):
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/editor/commands.py", line 43, in walk
    for res in walk(top / name, maxdepth - 1):
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/editor/commands.py", line 43, in walk
    for res in walk(top / name, maxdepth - 1):
  [Previous line repeated 2 more times]
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/editor/commands.py", line 35, in walk
    for name in os.listdir(top):
PermissionError: [Errno 13] Permission denied: '.wine/dosdevices/z:/dev/vboxusb'
Creating project 'pitzene'.
christopher-besch commented 2 years ago

The error occurs because you're running the Manim Editor in a directory containing files (possibly in sub-directories) that can't be opened for some reason. In your case it looks like your .PlayOnLinux and .wine directories are the reason. If you run the Manim Editor in a different directory, the errors should disappear.

christopher-besch commented 2 years ago

But the Manim Editor should catch this error. I'll implement that.

christopher-besch commented 2 years ago

I've published a new version. Could you check if that fixes it?

huncut2016 commented 2 years ago

Thanks for the quick answer. That's the next error after the update:

Creating project 'pitzene'.
ERROR:manim_editor.app:Exception on /create_project2 [POST]
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/app/main/routes.py", line 105, in scene_selection
    scenes = get_scenes()
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/editor/manim_loader.py", line 57, in get_scenes
    scene = get_scene(scene_index_path, len(scenes))
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/editor/manim_loader.py", line 37, in get_scene
    raw_sections = valid_json_load(path, get_config().SECTION_INDEX_SCHEMA)
  File "/home/user/.local/lib/python3.8/site-packages/manim_editor/editor/commands.py", line 55, in valid_json_load
    data = json.load(file)
  File "/usr/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.8/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 1: invalid start byte
christopher-besch commented 2 years ago

I created a new release with the fix. Could you try it?

huncut2016 commented 2 years ago

There are no errors, thanks for the fix! 😀