-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value for mac #138089
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
the news is the same so maybe we can ignore it? |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
only up to 3.13 new repr has this issue follow this patch title #129186 |
No, because we have already shipped a few releases since then, so we need a fresh one. |
learned that, thank you very much |
That's the backport. All PRs must first be done against main and we backport them when needed. We only use |
copy that, sorry for my wrong understand at first |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure but caching THEME() seems to go against the comment in THEME().
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
addressed thank you and add tests |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
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 |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
…hong0618/cpython into hy/close_issue_128636_for_mac
@@ -303,3 +303,15 @@ def test_getheightwidth_with_invalid_environ(self, _os_write): | |||
self.assertIsInstance(console.getheightwidth(), tuple) | |||
os.environ = [] | |||
self.assertIsInstance(console.getheightwidth(), tuple) | |||
|
|||
def test_mac_with_invalid_environ(self, _os_write): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_mac_with_invalid_environ(self, _os_write): | |
def test_is_mac_with_invalid_environ(self, _os_write): |
The change with |
copy will try this way but seems not simple for testing let me try |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@picnixz try a better one, learned something from this, thank you again without this patch(on main) ![]() with this patch ![]() |
Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
addressed and add co-author thanks for the kindly help and FYI, the new way is better but not so simple. tested about the theme change, the code is right, but |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
While I appreciate the willingness to fix this, I don't really like an argument to |
agreed but the two can_color is already there one is function another is a boolean, Can we refactor theme? Or there's other way to fix this |
I'm letting Łukasz shepherd this as I'm not a REPL expert
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
fixed thank you for the help |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
for mac if environ is valid and it will retrigger all of it
so I checked the code base in repr the os is from init
so make it in
__init__
is better and can avoidand that is not enough, we also need fix it the same way in
_can_colorize theme
cc @pablogsal
in my env it fixed the issue, and I wonder it maybe a litter faster
os.environ
#128636