Skip to content

gh-94512: Fix forced arg format in AC-processed resource - #94515

Merged
zooba merged 6 commits into
python:mainfrom
arhadthedev:clinic-resource-deformat
Jul 29, 2022
Merged

gh-94512: Fix forced arg format in AC-processed resource#94515
zooba merged 6 commits into
python:mainfrom
arhadthedev:clinic-resource-deformat

Conversation

@arhadthedev

@arhadthedevarhadthedev commented Jul 2, 2022

Copy link
Copy Markdown
Member

Please note that this commit also removes an old way to express optional parameters (it prevented the new style generation):

 /*[clinic input]
resource.prlimit
pid: pid_t
resource: int
- [- limits: object- ]+ limits: object = None
/
[clinic start generated code]*/

I hope it breaks nothing.

@arhadthedev

arhadthedev commented Jul 2, 2022

Copy link
Copy Markdown
MemberAuthor

I have no idea why resource module doesn't build on Ubuntu (a CI log contains neither compiler error nor any mention of the module name).

The failure manifests itself as a later inability to load a non-existent module in python -m unittest -v test.test_resource.ResourceTest.test_prlimit.

Running Release|x64 interpreter...
Traceback (most recent call last):
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\test\support\import_helper.py", line 78, in import_module
return importlib.import_module(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'resource'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\unittest\__main__.py", line 18, in <module>
main(module=None)
^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\unittest\main.py", line 101, in __init__
self.parseArgs(argv)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\unittest\main.py", line 150, in parseArgs
self.createTests()
^^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\unittest\main.py", line 161, in createTests
self.test = self.testLoader.loadTestsFromNames(self.testNames,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\unittest\loader.py", line 198, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\unittest\loader.py", line 198, in <listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\unittest\loader.py", line 132, in loadTestsFromName
module = __import__(module_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\test\test_resource.py", line 9, in <module>
resource = import_helper.import_module('resource')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oleg\Documents\dev\notmine\cpython\Lib\test\support\import_helper.py", line 82, in import_module
raise unittest.SkipTest(str(msg))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unittest.case.SkipTest: No module named 'resource'

@arhadthedev

Copy link
Copy Markdown
MemberAuthor

The bug is fixed.

Comment threadMisc/NEWS.d/next/Library/2022-07-03-23-09-45.gh-issue-94512.9wtOYT.rst Outdated
@zooba
zooba merged commit a739ee4 into python:mainJul 29, 2022
@arhadthedev
arhadthedev deleted the clinic-resource-deformat branch July 29, 2022 11:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@arhadthedev@zooba@bedevere-bot