Skip to content

getAttachments() - 'bytes' object has no attribute 'oid' error #193

@cooperaa

Description

@cooperaa

When calling getAttachments() for an artifact with multiple attachments with the same filename, I seem to get an error the second time pyral tries to get the attachment.

'bytes' object has no attribute 'oid' error

The original rally.get() request to get the user story showed that it has 23 attachments.
image

But when I called getAttachmentNames, it would return 24 results with two entries for the duplicated file name:
image

Through the UI, I confirmed there was a file named Archive.zip that was uploaded twice (on two different dates) but downloading them seemed to return identical files.

To resolve the issue, I converted the list of attachment files to a set and then fetched each individual attachment (instead of using getAttachments()). Not sure why having the list with duplicated file names causes getAttachments() to fail, but a quick bandaid could be to convert the list to a set as I had done here: https://github.com/RallyTools/RallyRestToolkitForPython/blob/master/pyral/restapi.py#L1702

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions