Skip to content

gh-107972: Argument Clinic: Ensure a C basename is provided after 'as' #107973

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 6 commits into from
Aug 15, 2023

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Aug 15, 2023

@erlend-aasland erlend-aasland added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 15, 2023
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

+1 to Adam's suggestions, but otherwise this LGTM. It appears we do fail() currently for at least the second case you're adding a test for, but the error message is pretty nonsensical currently:

Couldn't find existing function 'foo2'!

@erlend-aasland
Copy link
Contributor Author

+1 to Adam's suggestions, but otherwise this LGTM. It appears we do fail() currently for at least the second case you're adding a test for, but the error message is pretty nonsensical currently:

Couldn't find existing function 'foo2'!

Well, if you'd defined foo2 first, you would not get that failure; it would silently accept the weird line, but still produce a valid C basename (just using the full name).

@AlexWaygood
Copy link
Member

Well, if you'd defined foo2 first, you would not get that failure; it would silently accept the weird line, but still produce a valid C basename (just using the full name).

Yup, I gathered. Maybe we should do that in the test, actually, so that the only erroneous thing in the test case is the one we're explicitly testing that clinic catches?

@erlend-aasland
Copy link
Contributor Author

Try this weird input; clinic accepts it on main:

/*[clinic input]
output everything block
foo2
[clinic start generated code]*/

/*[clinic input]
output everything block
foo as = foo2
[clinic start generated code]*/

@erlend-aasland
Copy link
Contributor Author

Try this weird input; clinic accepts it on main:

And with that in mind, we should probably adjust the test case to look exactly like that.

@erlend-aasland
Copy link
Contributor Author

Yup, I gathered. Maybe we should do that in the test, actually, so that the only erroneous thing in the test case is the one we're explicitly testing that clinic catches?

I did not read this until now; we came to the same conclusion :)

@erlend-aasland erlend-aasland enabled auto-merge (squash) August 15, 2023 13:16
@erlend-aasland
Copy link
Contributor Author

If it won't backport cleanly, I'm inclined to not backport it.

@erlend-aasland
Copy link
Contributor Author

Thanks for the reviews!

@erlend-aasland erlend-aasland merged commit 607f18c into python:main Aug 15, 2023
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @erlend-aasland, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 607f18c89456cdc9064e27f86a7505e011209757 3.12

@miss-islington
Copy link
Contributor

Sorry, @erlend-aasland, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 607f18c89456cdc9064e27f86a7505e011209757 3.11

@erlend-aasland erlend-aasland removed needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 15, 2023
@bedevere-bot
Copy link

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

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

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/5072) and take a look at the build logs.
  4. Check if the failure is related to this commit (607f18c) 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/5072

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

== Tests result: ENV CHANGED ==

431 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 18 sec
  • test_multiprocessing_spawn: 1 min 31 sec
  • test_signal: 1 min 15 sec
  • test_multiprocessing_forkserver: 1 min 8 sec
  • test_multiprocessing_fork: 1 min 4 sec
  • test_socket: 38.0 sec
  • test_io: 37.9 sec
  • test_imaplib: 32.0 sec
  • test_subprocess: 28.3 sec
  • test_xmlrpc: 27.7 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 18 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

iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Aug 16, 2023
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.

5 participants