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

Errors when folder contains single-file uploads #35

Open
swinslow opened this issue Jul 20, 2020 · 0 comments
Open

Errors when folder contains single-file uploads #35

swinslow opened this issue Jul 20, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@swinslow
Copy link
Contributor

Many of the tasks and server functions call GetUploadNum. This function scans through the uploads in the specified folder. It appears to assume that all items in the folder will be links to unpacked uploads, and therefore appears to fail if they aren't -- for instance, if a single non-archive file has been uploaded. For example:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/steve/programming/lftools/fossdriver/fossdriver-dev/fossdriver/fossdriver/tasks.py", line 372, in run
    uploadNum = self.server.GetUploadNum(folderNum, self.uploadName)
  File "/Users/steve/programming/lftools/fossdriver/fossdriver-dev/fossdriver/fossdriver/server.py", line 157, in GetUploadNum
    u = self._getUploadData(folderNum, uploadName, exact)
  File "/Users/steve/programming/lftools/fossdriver/fossdriver-dev/fossdriver/fossdriver/server.py", line 138, in _getUploadData
    parsedUploads = fossdriver.parser.parseAllUploadDataForFolder(uploadData)
  File "/Users/steve/programming/lftools/fossdriver/fossdriver-dev/fossdriver/fossdriver/parser.py", line 86, in parseAllUploadDataForFolder
    u = parseUploadDataForFolderLineItem(lineItem)
  File "/Users/steve/programming/lftools/fossdriver/fossdriver-dev/fossdriver/fossdriver/parser.py", line 63, in parseUploadDataForFolderLineItem
    href = aTag.get("href", None)
AttributeError: 'NoneType' object has no attribute 'get'

One of these functions (perhaps parseUploadDataForFolderLineItem) should probably check to see whether the upload is actually an unpacked archive rather than a single file, and then act accordingly.

@swinslow swinslow added the bug Something isn't working label Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant