Skip to content

Change OSError and its subclasses attributes #2993

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 1 commit into from

Conversation

ChJR
Copy link
Contributor

@ChJR ChJR commented Aug 30, 2021

This PR provides specified attribute "characters_written" to BlockingIOError. Other unnecessary attributes are ignored in BlockingIOError such as winerror, filename, filename2.

@DimitrisJim
Copy link
Member

Related: #2974. Haven't been paying much attention to it but you might want to see the updates there since they should affect how this PR should try and implement this.

@youknowone youknowone added the z-ca-2021 Tag to track contrubution-academy 2021 label Oct 16, 2021
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch 2 times, most recently from 832ffad to 322057e Compare October 23, 2021 17:33
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch 3 times, most recently from cae22df to 4792bab Compare October 29, 2021 20:29
@ChJR ChJR mentioned this pull request Oct 30, 2021
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch from 4792bab to bbf87c7 Compare October 30, 2021 07:49
youknowone
youknowone previously approved these changes Oct 30, 2021
@@ -949,6 +949,7 @@ pub(super) mod types {
use crate::{
builtins::{traceback::PyTracebackRef, PyInt, PyTupleRef, PyTypeRef},
function::{FuncArgs, IntoPyResult},
pyobject::{PyValue, TypeProtocol},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pyobject::{PyValue, TypeProtocol},
PyValue, TypeProtocol,

@ChJR ChJR changed the title Extend BlockingIOError along with characters_written attribute Change OSError errno and strerror as attribute Oct 30, 2021
@ChJR ChJR changed the title Change OSError errno and strerror as attribute Change OSError and its subclasses attributes Oct 30, 2021
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch 2 times, most recently from 0a75d79 to e84bcb6 Compare November 2, 2021 17:51
@youknowone
Copy link
Member

@deantvv could you review this PR?

Copy link
Contributor

@deantvv deantvv left a comment

Choose a reason for hiding this comment

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

This PR looks great and makes OSError behaves more like CPython version.

}

fn os_error_parse_args(
exc_self: PyBaseExceptionRef,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
exc_self: PyBaseExceptionRef,
exc_self: &PyBaseExceptionRef,

Copy link
Contributor

Choose a reason for hiding this comment

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

We could use the reference to remove some clone.

@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch from 86e6443 to 8158379 Compare November 7, 2021 06:42
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch 3 times, most recently from 3f534a4 to 72bc663 Compare November 18, 2021 16:34
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch from 72bc663 to 6138130 Compare December 5, 2021 17:15
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch from 6138130 to ee9f041 Compare December 13, 2021 15:32
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch from ee9f041 to cd32e67 Compare February 23, 2022 15:06
@ChJR ChJR force-pushed the feature/BlockingIOError-Attr branch 3 times, most recently from 1c6547e to 48b6860 Compare April 2, 2022 18:44
@youknowone youknowone force-pushed the feature/BlockingIOError-Attr branch 2 times, most recently from 9b4598c to 9617789 Compare August 4, 2022 20:01
Make errno, strerror of OSError from readonly to attributes
Add OSError's attributes even they are None
@youknowone youknowone force-pushed the feature/BlockingIOError-Attr branch from 9617789 to db53fd2 Compare August 4, 2022 20:04
@ChJR
Copy link
Contributor Author

ChJR commented Aug 3, 2023

Too old to fix the codes. I close this PR and will check other issues.

@ChJR ChJR closed this Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
z-ca-2021 Tag to track contrubution-academy 2021
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants