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

Unpickleable ModuleImportError in unittest patch not backported to 2.7 #75478

Closed
RachelTobin mannequin opened this issue Aug 28, 2017 · 3 comments
Closed

Unpickleable ModuleImportError in unittest patch not backported to 2.7 #75478

RachelTobin mannequin opened this issue Aug 28, 2017 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@RachelTobin
Copy link
Mannequin

RachelTobin mannequin commented Aug 28, 2017

BPO 31297
Nosy @pitrou, @zware

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-04-27.04:10:24.214>
created_at = <Date 2017-08-28.23:53:15.179>
labels = ['type-bug', 'library']
title = 'Unpickleable ModuleImportError in unittest patch not backported to 2.7'
updated_at = <Date 2020-04-27.04:10:24.213>
user = 'https://bugs.python.org/RachelTobin'

bugs.python.org fields:

activity = <Date 2020-04-27.04:10:24.213>
actor = 'zach.ware'
assignee = 'none'
closed = True
closed_date = <Date 2020-04-27.04:10:24.214>
closer = 'zach.ware'
components = ['Library (Lib)']
creation = <Date 2017-08-28.23:53:15.179>
creator = 'Rachel Tobin'
dependencies = []
files = []
hgrepos = []
issue_num = 31297
keywords = []
message_count = 3.0
messages = ['300969', '300998', '367386']
nosy_count = 3.0
nosy_names = ['pitrou', 'zach.ware', 'Rachel Tobin']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue31297'
versions = ['Python 2.7']

@RachelTobin
Copy link
Mannequin Author

RachelTobin mannequin commented Aug 28, 2017

When running the unittest runner in parallel with an module import error present in your code, this exception is raised:

_pickle.PicklingError: Can't pickle <class 'unittest.loader.ModuleImportFailure'>: attribute lookup ModuleImportFailure on unittest.loader failed

unittest should be raising standard exceptions instead.

This was fixed in Python 3.4 with this patch: https://bugs.python.org/issue22903

Given that 2.7 is still supported, this patch should be backported.

@RachelTobin RachelTobin mannequin added type-crash A hard crash of the interpreter, possibly with a core dump stdlib Python modules in the Lib dir labels Aug 28, 2017
@pitrou
Copy link
Member

pitrou commented Aug 29, 2017

I'm guessing the backport may end up non-trivial. Do you want to try submitting a PR for it?

@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Jul 11, 2018
@zware
Copy link
Member

zware commented Apr 27, 2020

With 2.7 now EOL, I'm closing the issue.

@zware zware closed this as completed Apr 27, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants