Skip to content

Fix TypeError in _capture_transfer_failure - #16

Merged
liam-lloyd merged 1 commit into
mainfrom
issue-1784_fix_is_package_creation_error_handling
Feb 20, 2026
Merged

liam-lloyd merged 1 commit into
mainfrom
issue-1784_fix_is_package_creation_error_handling

Conversation

@liam-lloyd

Copy link
Copy Markdown
Member

Currently, _capture_transfer_failure makes a call to isinstance with three arguments. isinstance takes only two arguments, so this results in a TypeError. This commit updates the isinstance call to instead use a tuple to pass multiple classes.

@liam-lloyd

Copy link
Copy Markdown
Member Author

The linting error can be ignored, it exists on upstream

@liam-lloyd
liam-lloyd force-pushed the issue-1784_fix_is_package_creation_error_handling branch 2 times, most recently from ec395f3 to 92ec92f Compare February 20, 2026 18:10
Currently, _capture_transfer_failure makes a call to `isinstance` with
three arguments. `isinstance` takes only two arguments, so this results
in a TypeError. This commit updates the `isinstance` call to instead use
a tuple to pass multiple classes. It also adds unit tests for
_capture_transfer_failure.
@liam-lloyd
liam-lloyd force-pushed the issue-1784_fix_is_package_creation_error_handling branch from 92ec92f to 3984e02 Compare February 20, 2026 18:12
@cecilia-donnelly

Copy link
Copy Markdown
Member

I take it this is an upstream bug that you are fixing here in order to contribute back?

@liam-lloyd

Copy link
Copy Markdown
Member Author

I take it this is an upstream bug that you are fixing here in order to contribute back?

Yes (it is affecting us; in the rare cases where Archivematica processing fails this is hiding the cause of the failure from us)

@cecilia-donnelly cecilia-donnelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested but it looks reasonable!

@liam-lloyd
liam-lloyd merged commit 51b1eaf into main Feb 20, 2026
11 of 12 checks passed
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 this pull request may close these issues.

2 participants