Skip to content

gh-100061: Restore the global Input Stream pointer #102612

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

Merged
merged 9 commits into from
Aug 16, 2023

Conversation

uyw4687
Copy link
Contributor

@uyw4687 uyw4687 commented Mar 11, 2023

@hauntsaninja hauntsaninja changed the title pythongh-100061 Restore the global Input Stream pointer gh-100061: Restore the global Input Stream pointer Mar 11, 2023
@hauntsaninja hauntsaninja added the needs backport to 3.11 only security fixes label Mar 11, 2023
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Please add a new entry that describe the fix to user.
Such as: Fix wrong match in postive qualifiers. Patch by <your name>

@@ -2303,6 +2303,8 @@ def test_possessive_quantifiers(self):
self.assertIsNone(re.match("^x{}+$", "xxx"))
self.assertTrue(re.match("^x{}+$", "x{}"))

self.assertEqual(re.match('((.(?!C))++)', 'ABCD').span(), (0, 1))
Copy link

Choose a reason for hiding this comment

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

You may add a comment # gh-100061 for this test-case.

Copy link
Contributor Author

@uyw4687 uyw4687 Mar 13, 2023

Choose a reason for hiding this comment

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

Thanks, added :)

@ghost
Copy link

ghost commented Mar 13, 2023

IMO the fix is fine. Just adjust some details (comment/new_entry).
Need to wait for a core developer to merge the PR.

@arhadthedev
Copy link
Member

@ezio-melotti, @serhiy-storchaka (as regex experts)

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

Thank you for your contribution @animalize and @uyw4687.

This fixes also #106052

@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 only security fixes and removed skip news labels Aug 16, 2023
@serhiy-storchaka serhiy-storchaka merged commit abd9cc5 into python:main Aug 16, 2023
@miss-islington
Copy link
Contributor

Thanks @uyw4687 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @uyw4687 and @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker abd9cc52d94b8e2835322b62c29f09bb0e6fcfe9 3.12

@miss-islington
Copy link
Contributor

Sorry, @uyw4687 and @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker abd9cc52d94b8e2835322b62c29f09bb0e6fcfe9 3.11

serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Aug 16, 2023
…essive quantifiers (pythonGH-102612)

Restore the global Input Stream pointer after trying to match a sub-pattern.

Co-authored-by: Ma Lin <[email protected]>.
(cherry picked from commit abd9cc5)

Co-authored-by: SKO <[email protected]>
@bedevere-bot
Copy link

GH-108003 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Aug 16, 2023
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Aug 16, 2023
…essive quantifiers (pythonGH-102612)

Restore the global Input Stream pointer after trying to match a sub-pattern.

Co-authored-by: Ma Lin <[email protected]>.
(cherry picked from commit abd9cc5)

Co-authored-by: SKO <[email protected]>
@bedevere-bot
Copy link

GH-108004 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 16, 2023
@serhiy-storchaka serhiy-storchaka removed their assignment Aug 16, 2023
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 RHEL8 LTO + PGO 3.x has failed when building commit abd9cc5.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/78/builds/5080) and take a look at the build logs.
  4. Check if the failure is related to this commit (abd9cc5) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/78/builds/5080

Summary of the results of the build (if available):

== Tests result: ENV CHANGED ==

431 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 27 sec
  • test_multiprocessing_spawn: 1 min 59 sec
  • test_multiprocessing_forkserver: 1 min 16 sec
  • test_signal: 1 min 12 sec
  • test_multiprocessing_fork: 1 min 8 sec
  • test_socket: 42.6 sec
  • test_io: 40.1 sec
  • test_imaplib: 32.8 sec
  • test_subprocess: 32.3 sec
  • test_xmlrpc: 27.5 sec

1 test altered the execution environment:
test_interpreters

15 tests skipped:
test.test_asyncio.test_windows_events
test.test_asyncio.test_windows_utils test_devpoll test_gdb
test_ioctl test_kqueue test_launcher test_startfile test_tkinter
test_ttk test_winconsoleio test_winreg test_winsound test_wmi
test_zipfile64

Total duration: 2 min 37 sec

Click to see traceback logs
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1266, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1237, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 841, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 999, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1095, in get_code
  File "<frozen importlib._bootstrap_external>", line 1194, in get_data
TypeError: descriptor 'close' for '_io.BufferedReader' objects doesn't apply to a '_io.FileIO' object


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/threading.py", line 1052, in _bootstrap_inner
    self.run()
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/threading.py", line 989, in run
    self._target(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/test/test_interpreters.py", line 481, in task
    interp = interpreters.create()
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/test/support/interpreters.py", line 25, in create
    id = _interpreters.create(isolated=isolated)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: interpreter creation failed
k

serhiy-storchaka added a commit that referenced this pull request Aug 16, 2023
… quantifiers (GH-102612) (GH-108004)

Restore the global Input Stream pointer after trying to match a sub-pattern.

Co-authored-by: Ma Lin <[email protected]>

(cherry picked from commit abd9cc5)
    
Co-authored-by: SKO <[email protected]>
Yhg1s pushed a commit that referenced this pull request Aug 16, 2023
… quantifiers (GH-102612) (#108003)

Restore the global Input Stream pointer after trying to match a sub-pattern.

.
(cherry picked from commit abd9cc5)

Co-authored-by: SKO <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants