GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-94512: Fix forced arg format in AC-processed resource by arhadthedev · Pull Request #94515 · python/cpython

Conversation

@arhadthedev

@arhadthedev arhadthedev commented Jul 2, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

  • Issue: Fix forced arg format in AC-processed modules with custom converters #94512

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@arhadthedev
Fix forced arg format in AC-processed resource
7792291
@bedevere-bot bedevere-bot added the awaiting review label Jul 2, 2022
@arhadthedev arhadthedev mentioned this pull request Jul 2, 2022
Fix forced arg format in AC-processed modules with custom converters #94512
Open
6 of 7 tasks
@arhadthedev

arhadthedev commented Jul 2, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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'
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arhadthedev added 3 commits July 3, 2022 23:09
@arhadthedev
Add a NEWS entry
c10054d
@arhadthedev
Actualize a NEWS entry
7c5907a
@arhadthedev
Fix an optionality check (we need to compare with Py_None, not NULL)
c0a4f84
@arhadthedev

arhadthedev commented Jul 4, 2022

Copy link
Copy Markdown
Member Author

The bug is fixed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arhadthedev
Merge branch 'main' into clinic-resource-deformat
95b8316
@zooba zooba added the skip news label Jul 28, 2022
zooba
zooba reviewed Jul 28, 2022
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2022-07-03-23-09-45.gh-issue-94512.9wtOYT.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@arhadthedev
Delete 2022-07-03-23-09-45.gh-issue-94512.9wtOYT.rst
d349c5c
@zooba
zooba merged commit a739ee4 into python:main Jul 29, 2022
@bedevere-bot bedevere-bot removed the awaiting review label Jul 29, 2022
@arhadthedev
arhadthedev deleted the clinic-resource-deformat branch July 29, 2022 11:50
@aminalaee aminalaee mentioned this pull request Sep 28, 2023
Update resource.prlimit for Python 3.12+ python/typeshed#10794
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@zooba zooba zooba left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@arhadthedev @zooba @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.