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

[Bug Report]: "Is a directory" error #384

Closed
ColeAnthonyCapilongo5735 opened this issue Sep 20, 2024 · 10 comments · Fixed by #385
Closed

[Bug Report]: "Is a directory" error #384

ColeAnthonyCapilongo5735 opened this issue Sep 20, 2024 · 10 comments · Fixed by #385

Comments

@ColeAnthonyCapilongo5735
Copy link
Contributor

BlackboardSync Version

0.17.0

BlackboardSync Release

pipx

Python Version

3.12.6

Operating System and Version

Linux

University Name

Humber Polytechnic

Problem Description

After what seems to be the end of the sync (Shutting down download workers), I get an error that results in files not being downloaded, and instead some sort of shell HTML file instead.

Log File Contents

Exception in thread Thread-2 (_sync_task):
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.12/threading.py", line 1012, in run
    self._target(*self._args, **self._kwargs)
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/sync.py", line 177, in _sync_task
    start_time = self.download()
                 ^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/sync.py", line 153, in download
    start_time = self._download.download()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/download.py", line 109, in download
    self.executor.raise_exceptions()
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/executor.py", line 44, in raise_exceptions
    error = future.result()
            ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/base.py", line 27, in _write
    with path.open("wb") as f:
         ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/pathlib.py", line 1013, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: '/home/<user>/Documents/Humber/bbsync/2024/<my course>/Learning Materials/labs/Lab 02_Examples_pluginShell.c A shell that dynamically loads functions/pluginShell.c A shell that dynamically loads functions'
@ColeAnthonyCapilongo5735
Copy link
Contributor Author

The content looks like this on Blackboard:

image

I assume the issue here is related to the title of the content having slashes. However not all content like that fails to download.

@sanjacob
Copy link
Owner

Thanks for your report. I'll look into it.

@sanjacob
Copy link
Owner

Can you show me how the file structure looks for this content?

@ColeAnthonyCapilongo5735
Copy link
Contributor Author

The folder path is <sync folder>/2024/<course>/Learning Materials/labs/Lab 02_Examples_pluginShell.c A shell that dynamically loads functions/pluginShell.c A shell that dynamically loads functions/. Within that folder there is only one file, called pluginShell.html.

@sanjacob
Copy link
Owner

A fix is coming

@sanjacob
Copy link
Owner

sanjacob commented Sep 21, 2024

Hi there, can you try out 0.17.1-rc.1? It's available in the releases section or even on pypi. You may need to delete your configuration file (~/.config/blackboard_sync) and your previous downloads

Just let me know if this content is downloaded correctly, and if you have any further download exceptions.

@ColeAnthonyCapilongo5735
Copy link
Contributor Author

Definitely downloaded more content, but I did get this error, maybe unrelated:

Exception in thread Thread-2 (_sync_task):
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.12/threading.py", line 1012, in run
    self._target(*self._args, **self._kwargs)
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/sync.py", line 177, in _sync_task
    start_time = self.download()
                 ^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/sync.py", line 153, in download
    start_time = self._download.download()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/download.py", line 104, in download
    Course(course, job).write(self.download_location, self.executor)
    ^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/course.py", line 33, in __init__
    self.children.append(Content(content, api_path, job))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/content.py", line 44, in __init__
    self.handler = Handler(content, api_path, job)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/folder.py", line 22, in __init__
    self.children.append(content.Content(child, child_path, job))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/content.py", line 44, in __init__
    self.handler = Handler(content, api_path, job)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/folder.py", line 22, in __init__
    self.children.append(content.Content(child, child_path, job))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/content.py", line 44, in __init__
    self.handler = Handler(content, api_path, job)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/document.py", line 30, in __init__
    Attachment(attachment, api_path, job)
  File "/home/<user>/.local/pipx/venvs/blackboardsync/lib/python3.12/site-packages/blackboard_sync/content/attachment.py", line 30, in __init__
    self.filename = filename + real_ext
                    ~~~~~~~~~^~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

This is without deleting config or previous downloads.

@ColeAnthonyCapilongo5735
Copy link
Contributor Author

@sanjacob ok I'm still getting "is a directory" errors with 0.17.1 unfortunately

@sanjacob
Copy link
Owner

sanjacob commented Oct 1, 2024

@ColeAnthonyCapilongo5735 you need to delete all your downloads and start from scratch. Delete your config file too.

@sanjacob
Copy link
Owner

sanjacob commented Oct 1, 2024

Were you able to fix 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

Successfully merging a pull request may close this issue.

2 participants