Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-131421: fix ASDL grammar forDict to have anexpr?* keys field#131419

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 5 commits intopython:mainfromDemonstrandum:main
May 4, 2025

Conversation

Demonstrandum
Copy link
Contributor

@DemonstrandumDemonstrandum commentedMar 18, 2025
edited by bedevere-appbot
Loading

In theast documentation for Python:

When doing dictionary unpacking using dictionary literals the expression to be expanded goes in the values list, with aNone at the corresponding position inkeys.

Hence,keys is really aexpr?* andnot aexpr*.

In the `ast` documentation for Python:*https://docs.python.org/3/library/ast.html#ast.Dictit is made clear that:> When doing dictionary unpacking using dictionary literals the expression to be expanded goes in the values list, with a `None` at the corresponding position in `keys`.Hence, `keys` is really a `expr?*` and *not* a `expr*`.
@ghost
Copy link

ghost commentedMar 18, 2025
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@DemonstrandumDemonstrandum changed the titlePython.asdl: FixDict variant to have anexpr?* keys field.gh-131421: Python.asdl: FixDict variant to have anexpr?* keys field.Mar 18, 2025
@@ -63,7 +63,7 @@ module Python
| UnaryOp(unaryop op, expr operand)
| Lambda(arguments args, expr body)
| IfExp(expr test, expr body, expr orelse)
| Dict(expr* keys, expr* values)
| Dict(expr?* keys, expr* values)
Copy link
Member

Choose a reason for hiding this comment

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

This kind of change makes me wonder whether we should also add '+' to indicate 1 or more items. For instancenonlocal requires at least one name, same forimport,global and others.

Similarly, there is no explanation of what* and? actually mean. While they can be inferred, I would expect a caption for them. WDYT@JelleZijlstra?

@picnixzpicnixz changed the titlegh-131421: Python.asdl: FixDict variant to have anexpr?* keys field.gh-131421: fix ASDL grammar forDict to have anexpr?* keys fieldMar 18, 2025
@JelleZijlstra
Copy link
Member

Python.asdl is used to generate the AST code, and this change doesn't compile (to reproduce runmake regen-ast locally; ideally we'd fix CI to do that).

I don't think it's really worth changing the grammar here.

@picnixz
Copy link
Member

picnixz commentedMar 18, 2025
edited
Loading

I don't think it's really worth changing the grammar here.

Can we perhaps add a comment instead? because now that I think about it, for static analysis tools, we could be surprised (like, if we only focus on the ASDL and not on the documented entry itself). [I could be surprised in Sphinx though I don't think I've encountered an issue with this]

@Demonstrandum
Copy link
ContributorAuthor

It represents a point where it completely breaks expectation, where up until then, the ASDL (as far as I have observed) was being completely respected by theast module. Since* and? are modifiers on types, andexpr? is still a type, morally a star should be able to follow any type, includingexpr? to get aexpr?*, for example.

Would this be very difficult to parse / break a lot of handling?

@JelleZijlstra
Copy link
Member

It's been like this for a long time and I don't recall any other reports of confusion about it, so there's a good argument to stick with the working code.

That said, if you can provide a patch that parses this new syntax correctly and that compiles correctly, we can consider it.

Demonstrandum reacted with thumbs up emoji

@Demonstrandum
Copy link
ContributorAuthor

@JelleZijlstra I updated theParser/asdl.py ASDL parser to support chained quantifiers. I made sure theopt andseq interface it exposes remains the same (based of the last quantifier supplied). This means the generatedPython/Python-ast.c is unchanged.

Naturally,make regen-ast works now.

Comment on lines 67 to 71
class Quantifier:
class _Optional: pass
class _Sequence: pass
OPTIONAL = _Optional()
SEQUENCE = _Sequence()
Copy link
Member

Choose a reason for hiding this comment

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

Could this just be an enum?

picnixz reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Sure, I just prefer these to have unique/singleton values (as opposed toints or whatnot).

I can change it if its outside the expected coding style.

Copy link
Member

Choose a reason for hiding this comment

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

If you wanted singletons you could also just doOPTIONAL = object() but to be honest I think an Enum/StrEnum is a better choice here since it's more explicit.

picnixz reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

(one reason to do the class trick is to have a bit of a nicer repr(), but OTOH, I don't think we need to worry about importingenum)

tomasr8 reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Is it worth importingenum? If you want to add your suggested change I can commit it.

Copy link
Member

Choose a reason for hiding this comment

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

Yes let's use an enum here, it's the right tool.

Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

I'm not sure if this is already the case or not, but can you quickly check that the tests forast.parse('{}') handle this case?

elif self.cur_token.kind == TokenKind.Question:
is_opt = True
quantifiers = []
while self.cur_token.kind in (TokenKind.Asterisk, TokenKind.Question):
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we check that we don't have** for instance or???

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe. But both ?? and ** are legitimate types, ** perhaps more legitimate than ?? is.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, actually the current parser doesn't care. I thought that it would have warned the user. And shouldT** actually mean a list of list of T? is the obtained C code designed to handle this kind of grammar?

I have no strong opinion now on whether we should warn??.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

There is essentially no change to the C code at all at this point. I don't know how this was handled before, since expr?* was always there implicitly, but this didn't seem to matter.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I think this is fine as is

class Field(AST):
def __init__(self, type, name=None,seq=False, opt=False):
def __init__(self, type, name=None,quantifiers=None):
Copy link
Member

Choose a reason for hiding this comment

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

Is there a need to support more than two qualifiers? and/or shouldn't we check the consistency of those qualifiers as well?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Currently there are no more than two quantifiers on any type, as per my change to Python.asdl.

I'm just implementing the EBNF grammar described at the top of the asdl.py file. And I don't think this files does any amount of extra validation so far anyway.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Copy link
Member

@JelleZijlstraJelleZijlstra left a comment

Choose a reason for hiding this comment

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

Looks good, I'll push the enum change

Comment on lines 67 to 71
class Quantifier:
class _Optional: pass
class _Sequence: pass
OPTIONAL = _Optional()
SEQUENCE = _Sequence()
Copy link
Member

Choose a reason for hiding this comment

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

Yes let's use an enum here, it's the right tool.

@JelleZijlstraJelleZijlstra merged commit3084070 intopython:mainMay 4, 2025
23 checks passed
@bedevere-bot
Copy link

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

Hi! The buildbotAMD64 CentOS9 NoGIL 3.x (tier-1) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/1609/builds/2443) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/1609/builds/2443

Failed tests:

  • test_asdl_parser

Failed subtests:

  • test_product - test.test_asdl_parser.TestAsdlParser.test_product
  • test_attributes - test.test_asdl_parser.TestAsdlParser.test_attributes

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.itamaro-centos-aws.nogil/build/Lib/test/test_asdl_parser.py", line72, intest_attributesself.assertEqual(repr(stmt.attributes[0]),'Field(int, lineno)')~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.itamaro-centos-aws.nogil/build/Lib/test/test_asdl_parser.py", line63, intest_productself.assertEqual(~~~~~~~~~~~~~~~~^str(alias),^^^^^^^^^^^'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'[Field(int, lineno), Field(int, col_offset),'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])

@bedevere-bot
Copy link

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

Hi! The buildbotwasm32-wasi 3.x (tier-2) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/1046/builds/8548) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/1046/builds/8548

Failed tests:

  • test_asdl_parser

Failed subtests:

  • test_product - test.test_asdl_parser.TestAsdlParser.test_product
  • test_attributes - test.test_asdl_parser.TestAsdlParser.test_attributes

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/Lib/test/test_asdl_parser.py", line63, intest_productself.assertEqual(~~~~~~~~~~~~~~~~^str(alias),^^^^^^^^^^^'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'[Field(int, lineno), Field(int, col_offset),'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])Traceback (most recent call last):  File"/Lib/test/test_asdl_parser.py", line72, intest_attributesself.assertEqual(repr(stmt.attributes[0]),'Field(int, lineno)')~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)

@bedevere-bot
Copy link

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

Hi! The buildbotARM64 MacOS M1 NoGIL 3.x (tier-2) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/1270/builds/4691) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/1270/builds/4691

Failed tests:

  • test_asdl_parser

Failed subtests:

  • test_product - test.test_asdl_parser.TestAsdlParser.test_product
  • test_attributes - test.test_asdl_parser.TestAsdlParser.test_attributes

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.nogil/build/Lib/test/test_asdl_parser.py", line72, intest_attributesself.assertEqual(repr(stmt.attributes[0]),'Field(int, lineno)')~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)Traceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.nogil/build/Lib/test/test_asdl_parser.py", line63, intest_productself.assertEqual(~~~~~~~~~~~~~~~~^str(alias),^^^^^^^^^^^'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'[Field(int, lineno), Field(int, col_offset),'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])

@bedevere-bot
Copy link

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

Hi! The buildbotARM Raspbian 3.x (tier-3) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/424/builds/10540) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/424/builds/10540

Failed tests:

  • test_asdl_parser

Failed subtests:

  • test_product - test.test_asdl_parser.TestAsdlParser.test_product
  • test_attributes - test.test_asdl_parser.TestAsdlParser.test_attributes
  • test_async_remote_stack_trace - test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_external_inspection.py", line271, intest_async_remote_stack_traceself.assertEqual(stack_trace, expected_stack_trace)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:Lists differ: [[('c[62 chars]y', 10), ('c4', '/tmp/test_python_kwzu5r9s/tmp[1353 chars]]]]]] != [[('c[62 chars]y', 11), ('c4', '/tmp/test_python_kwzu5r9s/tmp[1368 chars]]]]]]Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_asdl_parser.py", line63, intest_productself.assertEqual(~~~~~~~~~~~~~~~~^str(alias),^^^^^^^^^^^'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'[Field(int, lineno), Field(int, col_offset),'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])Traceback (most recent call last):  File"/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_asdl_parser.py", line72, intest_attributesself.assertEqual(repr(stmt.attributes[0]),'Field(int, lineno)')~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)

@bedevere-bot
Copy link

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

Hi! The buildbotx86 Debian Non-Debug with X 3.x (no tier) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/1245/builds/5302) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/1245/builds/5302

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

==

Click to see traceback logs
Traceback (most recent call last):  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/test_asdl_parser.py"�[0m, line �[35m72�[0m, in �[35mtest_attributes�[0m    �[31mself.assertEqual�[0m�[1;31m(repr(stmt.attributes[0]),'Field(int, lineno)')�[0m    �[31m~~~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m�[1;35mAssertionError�[0m:�[35m'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)�[0mTraceback (most recent call last):  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/test_asdl_parser.py"�[0m, line �[35m63�[0m, in �[35mtest_product�[0m    �[31mself.assertEqual�[0m�[1;31m(�[0m    �[31m~~~~~~~~~~~~~~~~�[0m�[1;31m^�[0m        �[1;31mstr(alias),�[0m        �[1;31m^^^^^^^^^^^�[0m        �[1;31m'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'�[0m        �[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m        �[1;31m'[Field(int, lineno), Field(int, col_offset),'�[0m        �[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m        �[1;31m'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')�[0m        �[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m�[1;35mAssertionError�[0m:�[35m'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])�[0m

@bedevere-bot
Copy link

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

Hi! The buildbotAMD64 FreeBSD14 3.x (tier-3) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/1232/builds/5658) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/1232/builds/5658

Failed tests:

  • test_asdl_parser

Failed subtests:

  • test_product - test.test_asdl_parser.TestAsdlParser.test_product
  • test_attributes - test.test_asdl_parser.TestAsdlParser.test_attributes

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/test_asdl_parser.py", line63, intest_productself.assertEqual(~~~~~~~~~~~~~~~~^str(alias),^^^^^^^^^^^'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'[Field(int, lineno), Field(int, col_offset),'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/test_asdl_parser.py", line72, intest_attributesself.assertEqual(repr(stmt.attributes[0]),'Field(int, lineno)')~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)

JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull requestMay 4, 2025
PRpython#131419 broke this, but we failed to run tests on the PR due to a bugin our script.
@JelleZijlstra
Copy link
Member

Tests didn't run due to a bug in our logic and unfortunately this did break some tests, I put up another PR to fix.

@bedevere-bot
Copy link

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

Hi! The buildbotAMD64 FreeBSD 3.x (tier-3) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/1223/builds/6120) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/1223/builds/6120

Failed tests:

  • test_asdl_parser

Failed subtests:

  • test_product - test.test_asdl_parser.TestAsdlParser.test_product
  • test_attributes - test.test_asdl_parser.TestAsdlParser.test_attributes

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/buildbot/buildarea/3.x.ware-freebsd/build/Lib/test/test_asdl_parser.py", line63, intest_productself.assertEqual(~~~~~~~~~~~~~~~~^str(alias),^^^^^^^^^^^'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'[Field(int, lineno), Field(int, col_offset),'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])Traceback (most recent call last):  File"/buildbot/buildarea/3.x.ware-freebsd/build/Lib/test/test_asdl_parser.py", line72, intest_attributesself.assertEqual(repr(stmt.attributes[0]),'Field(int, lineno)')~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)

ambv pushed a commit that referenced this pull requestMay 4, 2025
PR#131419 broke this, but we failed to run tests on the PR due to a bugin our script.
@bedevere-bot
Copy link

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

Hi! The buildbotAMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x (no tier) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/469/builds/10996) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/469/builds/10996

Failed tests:

  • test_asdl_parser

Failed subtests:

  • test_product - test.test_asdl_parser.TestAsdlParser.test_product
  • test_attributes - test.test_asdl_parser.TestAsdlParser.test_attributes

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_asdl_parser.py", line72, intest_attributesself.assertEqual(repr(stmt.attributes[0]),'Field(int, lineno)')~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_asdl_parser.py", line63, intest_productself.assertEqual(~~~~~~~~~~~~~~~~^str(alias),^^^^^^^^^^^'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'[Field(int, lineno), Field(int, col_offset),'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])

@bedevere-bot
Copy link

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

Hi! The buildbotx86-64 MacOS Intel NoGIL 3.x (tier-1) has failed when building commit3084070.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/1258/builds/4902) and take a look at the build logs.
  4. Check if the failure is related to this commit (3084070) 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/#/builders/1258/builds/4902

Failed tests:

  • test_asdl_parser

Failed subtests:

  • test_product - test.test_asdl_parser.TestAsdlParser.test_product
  • test_attributes - test.test_asdl_parser.TestAsdlParser.test_attributes

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/test/test_asdl_parser.py", line72, intest_attributesself.assertEqual(repr(stmt.attributes[0]),'Field(int, lineno)')~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Field(int, lineno, quantifiers=[])' != 'Field(int, lineno)'- Field(int, lineno, quantifiers=[])+ Field(int, lineno)Traceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/traceback.py", line14, in<module>import _colorize  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/_colorize.py", line163, in<module>    set_theme()  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/_colorize.py", line148, inset_theme    colors= get_colors()  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/_colorize.py", line92, inget_colorsif colorizeor can_colorize(file=file):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/_colorize.py", line136, incan_colorizereturn os.isatty(file.fileno())ValueError:I/O operation on closed fileTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/resource_tracker.py", line314, inmain_CLEANUP_FUNCS[rtype](name)FileNotFoundError:[Errno 2] No such file or directoryTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/process.py", line320, in_bootstrapself.run()~~~~~~~~^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/process.py", line108, inrunself._target(*self._args,**self._kwargs)~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/test/_test_multiprocessing.py", line513, in_sleep_some    time.sleep(100)~~~~~~~~~~^^^^^KeyboardInterruptkTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/util.py", line216, in__call__    res=self._callback(*self._args,**self._kwargs)  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/synchronize.py", line87, in_cleanup    unregister(name,"semaphore")  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/resource_tracker.py", line216, inunregisterself._send('UNREGISTER', name, rtype)  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/resource_tracker.py", line226, in_send    warnings.warn(UserWarning:ResourceTracker called reentrantly for resource cleanup, which is unsupported. The semaphore object '/mp-5xlj1a0h' might leak.Warning -- Unraisable exceptionException ignored while calling weakref callback <Finalize object, dead>:Traceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/util.py", line216, in__call__    res=self._callback(*self._args,**self._kwargs)  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/synchronize.py", line87, in_cleanup    unregister(name,"semaphore")  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/resource_tracker.py", line216, inunregisterself._send('UNREGISTER', name, rtype)  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/resource_tracker.py", line226, in_send    warnings.warn(UserWarning:ResourceTracker called reentrantly for resource cleanup, which is unsupported. The semaphore object '/mp-s8g8kwq9' might leak.kTraceback (most recent call last):  File"<string>", line1, in<module>  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/multiprocessing/resource_tracker.py", line317, inmain    warnings.warn('resource_tracker:%r:%s'% (name, e))UserWarning:resource_tracker: '/mp-s8g8kwq9': [Errno 2] No such file or directoryTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/test/test_asdl_parser.py", line63, intest_productself.assertEqual(~~~~~~~~~~~~~~~~^str(alias),^^^^^^^^^^^'Product([Field(identifier, name), Field(identifier, asname, opt=True)],'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'[Field(int, lineno), Field(int, col_offset),'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'Prod[22 chars] name, quantifiers=[]), Field(identifier, asna[209 chars]])])' != 'Prod[22 chars] name), Field(identifier, asname, opt=True)], [113 chars]e)])'- Product([Field(identifier, name, quantifiers=[]), Field(identifier, asname, quantifiers=[, OPTIONAL])], [Field(int, lineno, quantifiers=[]), Field(int, col_offset, quantifiers=[]), Field(int, end_lineno, quantifiers=[, OPTIONAL]), Field(int, end_col_offset, quantifiers=[, OPTIONAL])])+ Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

@tomasr8tomasr8tomasr8 left review comments

@picnixzpicnixzpicnixz left review comments

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

@isidenticalisidenticalAwaiting requested review from isidenticalisidentical is a code owner

@Eclips4Eclips4Awaiting requested review from Eclips4Eclips4 is a code owner

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@Demonstrandum@JelleZijlstra@picnixz@bedevere-bot@tomasr8

[8]ページ先頭

©2009-2025 Movatter.jp