Bug 2359530

Summary: python-beancount fails to build with Python 3.14: TestReferenceCounting and TestLexer fail with AssertionError
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-beancountAssignee: Davide Cavalca <davide>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: davide, extras-orphan, fti-bugs, ksurma, mhroncok
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-beancount-3.1.0-4.fc44 python-beancount-3.1.0-4.fc43 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-08-15 16:50:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2322407, 2339432, 2339435, 2384425, 2371815, 2371816    

Description Karolina Surma 2025-04-14 15:12:47 UTC
python-beancount fails to build with Python 3.14.0a7.

___________________________ TestLexer.test_bad_date ____________________________

self = <beancount.parser.lexer_test.TestLexer testMethod=test_bad_date>
tokens = [('error', 1, b'2013-12-98', None), ('EOL', 2, b'\n', None)]
errors = [LexerError(source={'filename': '', 'lineno': 1}, message='ValueError: day 98 must be in range 1..31 for month 12 in year 2013', entry=None)]

    @lex_tokens
    def test_bad_date(self, tokens, errors):
        """\
          2013-12-98
        """
        self.assertEqual(
            [
                ("error", 1, b"2013-12-98", None),
                ("EOL", 2, b"\n", None),
            ],
            tokens,
        )
        self.assertTrue(errors)
>       self.assertRegex(errors[0].message, "out of range|month must be|day must be in")
E       AssertionError: Regex didn't match: 'out of range|month must be|day must be in' not found in 'ValueError: day 98 must be in range 1..31 for month 12 in year 2013'

beancount/parser/lexer_test.py:275: AssertionError
____________________ TestReferenceCounting.test_parser_lex _____________________

self = <beancount.parser.parser_test.TestReferenceCounting testMethod=test_parser_lex>

    def test_parser_lex(self):
        # Do not use a string to avoid issues due to string interning.
        name = object()
        # Note that passing name as an argument to sys.getrefcount()
        # counts as one reference, thus the minimum reference count
        # returned for any object is 2.
>       self.assertEqual(sys.getrefcount(name), 2)
E       AssertionError: 1 != 2

beancount/parser/parser_test.py:192: AssertionError
________________ TestReferenceCounting.test_parser_lex_filename ________________

self = <beancount.parser.parser_test.TestReferenceCounting testMethod=test_parser_lex_filename>

    def test_parser_lex_filename(self):
        # Do not use a string to avoid issues due to string interning.
        name = object()
>       self.assertEqual(sys.getrefcount(name), 2)
E       AssertionError: 1 != 2

beancount/parser/parser_test.py:233: AssertionError
_________________ TestReferenceCounting.test_parser_lex_multi __________________

self = <beancount.parser.parser_test.TestReferenceCounting testMethod=test_parser_lex_multi>

    def test_parser_lex_multi(self):
        file1 = io.BytesIO(b"")
        file1.name = object()
        self.assertEqual(sys.getrefcount(file1.name), 2)
    
        file2 = io.BytesIO(b"")
        file2.name = object()
        self.assertEqual(sys.getrefcount(file2.name), 2)
    
        builder = lexer.LexBuilder()
        parser = _parser.Parser(builder)
        _tokens = list(parser.lex(file1))
        _tokens = list(parser.lex(file2))
    
        del parser
        # Once the Parser object is gone we should have just the local
        # references to the file objects and one references to the names.
>       self.assertEqual(sys.getrefcount(file1), 2)
E       AssertionError: 1 != 2

beancount/parser/parser_test.py:274: AssertionError
___________________ TestReferenceCounting.test_parser_parse ____________________

self = <beancount.parser.parser_test.TestReferenceCounting testMethod=test_parser_parse>

    def test_parser_parse(self):
        # Do not use a string to avoid issues due to string interning.
        name = object()
>       self.assertEqual(sys.getrefcount(name), 2)
E       AssertionError: 1 != 2

beancount/parser/parser_test.py:282: AssertionError
=========================== short test summary info ============================
FAILED beancount/parser/lexer_test.py::TestLexer::test_bad_date - AssertionEr...
FAILED beancount/parser/parser_test.py::TestReferenceCounting::test_parser_lex
FAILED beancount/parser/parser_test.py::TestReferenceCounting::test_parser_lex_filename
FAILED beancount/parser/parser_test.py::TestReferenceCounting::test_parser_lex_multi
FAILED beancount/parser/parser_test.py::TestReferenceCounting::test_parser_parse

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08899226-python-beancount/

For all our attempts to build python-beancount with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-beancount/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Karolina Surma 2025-06-11 15:56:42 UTC
*** Bug 2371814 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Fails To Install 2025-06-20 19:52:21 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 3 Fedora Fails To Install 2025-07-15 08:35:56 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 4+ weeks.
This is the second reminder (step 4) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 4 Fedora Fails To Install 2025-08-12 12:18:55 UTC
This package has been orphaned.

You can pick it up at https://src.fedoraproject.org/rpms/python-beancount by clicking button "Take". If nobody picks it up, it will be retired and removed from a distribution.

Comment 5 Fedora Admin user for bugzilla script actions 2025-08-12 13:28:44 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 6 Fedora Fails To Install 2025-08-14 20:35:00 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 7 Fedora Admin user for bugzilla script actions 2025-08-15 01:09:57 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 8 Fedora Update System 2025-08-15 16:47:06 UTC
FEDORA-2025-107461fc29 (python-beancount-3.1.0-4.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-107461fc29

Comment 9 Fedora Update System 2025-08-15 16:50:35 UTC
FEDORA-2025-107461fc29 (python-beancount-3.1.0-4.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2025-08-15 16:56:16 UTC
FEDORA-2025-cde26f9326 (python-beancount-3.1.0-4.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-cde26f9326

Comment 11 Fedora Update System 2025-08-15 16:59:29 UTC
FEDORA-2025-cde26f9326 (python-beancount-3.1.0-4.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Red Hat Bugzilla 2025-12-14 04:25:03 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days