Bug 1749578 - libstdc++: SyntaxWarning in xmethods.py
Summary: libstdc++: SyntaxWarning in xmethods.py
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 32
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-05 22:25 UTC by Jerry James
Modified: 2021-04-29 17:41 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-29 17:41:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jerry James 2019-09-05 22:25:25 UTC
Description of problem:
I'm trying to debug an issue in Rawhide, and I keep getting this message while working with gdb:

/lib64/../share/gcc-9/python/libstdcxx/v6/xmethods.py:731: SyntaxWarning: list indices must be integers or slices, not str; perhaps you missed a comma?
  refcounts = ['_M_refcount']['_M_pi']

The code in question is part of class SharedPtrUseCountWorker.  The method
looks like this:

    def __call__(self, obj):
        refcounts = ['_M_refcount']['_M_pi']
        return refcounts['_M_use_count'] if refcounts else 0

That does look wrong.  Should that be "refcounts = obj['_M_refcount']['_M_pi']"?

Version-Release number of selected component (if applicable):
libstdc++-9.2.1-1.fc32.x86_64

How reproducible:
Not sure.  I'm seeing it a lot, but this is template-heavy code that I am working with.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jonathan Wakely 2019-09-06 12:47:46 UTC
(In reply to Jerry James from comment #0)
> That does look wrong.  Should that be "refcounts =
> obj['_M_refcount']['_M_pi']"?

Indeed, thanks.

Comment 2 Jonathan Wakely 2019-09-11 11:42:17 UTC
Fixed upstream, so it should get fixed in Fedora next time Jakub updates the gcc package.

Comment 3 Ben Cotton 2020-02-11 17:56:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 4 Fedora Program Management 2021-04-29 17:09:10 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Jonathan Wakely 2021-04-29 17:41:14 UTC
This got fixed in GCC 9.3.0 and 10.1.0 so the fix made it into Fedora ages ago.


Note You need to log in before you can comment on or make changes to this bug.