Skip to content

bpo-40899: Document exception raised when module cannot be imported #27709

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

Closed
wants to merge 6 commits into from

Conversation

dukecat0
Copy link
Contributor

@dukecat0 dukecat0 commented Aug 10, 2021

Copy link
Contributor

@ambv ambv left a comment

Choose a reason for hiding this comment

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

  1. Note Ronald's comment on arbitrary exceptions being raised from a module body while it's being imported.
  2. Please don't insert error handling information in the leading paragraph. Look at other functions in functions.rst, they have exception information listed further in the text, usually as the last paragraph describing them.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@dukecat0 dukecat0 marked this pull request as draft August 12, 2021 13:11
@gpshead
Copy link
Member

gpshead commented Aug 18, 2021

  1. Note Ronald's comment on arbitrary exceptions being raised from a module body while it's being imported.
  2. Please don't insert error handling information in the leading paragraph. Look at other functions in functions.rst, they have exception information listed further in the text, usually as the last paragraph describing them.

while I've Approved this change from the standpoint of not being a bad thing to document, I do think the above should be addressed first.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Sep 18, 2021
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.11 only security fixes label May 20, 2022
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 11, 2022
@iritkatriel
Copy link
Member

@meowmeowmeowcat This has been awaiting changes for over a year. Are you planning to finish this or shall we close it so someone else can pick it up?

@iritkatriel iritkatriel added the pending The issue will be closed if no feedback is provided label Nov 23, 2022
Copy link
Member

@iritkatriel iritkatriel left a comment

Choose a reason for hiding this comment

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

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@dukecat0 dukecat0 marked this pull request as ready for review November 24, 2022 09:27
@dukecat0
Copy link
Contributor Author

Are you planning to finish this or shall we close it so someone else can pick it up?

I am going to finish this. Sorry for the late response!

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@iritkatriel, @ambv, @gpshead: please review the changes made to this pull request.

@iritkatriel iritkatriel removed the pending The issue will be closed if no feedback is provided label Nov 24, 2022
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Comment on lines +2021 to +2022
An :exc:`ImportError` exception can be raised if the module cannot be imported
successfully.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I like this wording - what do you mean "can be raised", it sounds like it is possible for import to fail and not raise an exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note Ronald's comment on arbitrary exceptions being raised from a module body while it's being imported.

It means arbitrary exceptions can also be raised.

Copy link
Member

Choose a reason for hiding this comment

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

I understand the intent, but I don't think that's the only possible interpretation of the current wording.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just found out that #94662 is also doing the same thing. Would you prefer that one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting change review docs Documentation in the Doc dir needs backport to 3.11 only security fixes skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants