Skip to content

Errors when folder contains single-file uploads #35

@swinslow

Description

@swinslow

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions