Skip to content

Python3.13.3: test_functools fail during build with --enable-optimization and --without-docs-string #134092

Not planned
@vincentpichon

Description

@vincentpichon

Bug report

Bug description:

test_functools fail during build of python3.13.3 with --enable-optimization and --without-docs-string

Hello, everyone.
I do not know if this is a normal behavior or a bug but,
I tried to compile python 3.13.3 with option : --without-doc-strings and --enable-optimizations
But it always fail during test_functools :

======================================================================
FAIL: test_doc (test.test_functools.TestCachedProperty.test_doc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 3318, in test_doc
    self.assertEqual(CachedCostItem.cost.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     ("The cost of the item."
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'The cost of the item.' != None

======================================================================
FAIL: test_double_wrapped_methods (test.test_functools.TestSingleDispatch.test_double_wrapped_methods) (meth=<function TestSingleDispatch.test_double_wrapped_methods.<locals>.WithSingleDispatch.cls_context_manager at 0x7f39614684a0>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2863, in test_double_wrapped_methods
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_double_wrapped_methods (test.test_functools.TestSingleDispatch.test_double_wrapped_methods) (meth=<function TestSingleDispatch.test_double_wrapped_methods.<locals>.WithSingleDispatch.cls_context_manager at 0x7f3961469300>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2863, in test_double_wrapped_methods
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_double_wrapped_methods (test.test_functools.TestSingleDispatch.test_double_wrapped_methods) (meth=<function TestSingleDispatch.test_double_wrapped_methods.<locals>.WithSingleDispatch.decorated_classmethod at 0x7f39614694e0>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2863, in test_double_wrapped_methods
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_double_wrapped_methods (test.test_functools.TestSingleDispatch.test_double_wrapped_methods) (meth=<function TestSingleDispatch.test_double_wrapped_methods.<locals>.WithSingleDispatch.decorated_classmethod at 0x7f3961469580>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2863, in test_double_wrapped_methods
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.func at 0x7f396146b2e0>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2771, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.func at 0x7f396338bce0>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2771, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.cls_func at 0x7f396338ba60>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2771, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.cls_func at 0x7f396338bc40>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2771, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.static_func at 0x7f396338bba0>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2771, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

======================================================================
FAIL: test_method_wrapping_attributes (test.test_functools.TestSingleDispatch.test_method_wrapping_attributes) (meth=<function TestSingleDispatch.test_method_wrapping_attributes.<locals>.A.static_func at 0x7f396338bd80>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Python-3.13.3/Lib/test/test_functools.py", line 2771, in test_method_wrapping_attributes
    self.assertEqual(meth.__doc__,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
                     ('My function docstring'
                     ^^^^^^^^^^^^^^^^^^^^^^^^
                      if support.HAVE_DOCSTRINGS
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      else None))
                      ^^^^^^^^^^^
AssertionError: 'My function docstring' != None

----------------------------------------------------------------------
Ran 284 tests in 1.776s

FAILED (failures=11, skipped=4)
test test_functools failed
0:00:02 load avg: 1.21 [1/1/1] test_functools failed (11 failures)

== Tests result: FAILURE ==

1 test failed:
    test_functools

Total duration: 2.1 sec
Total tests: run=284 failures=11 skipped=4
Total test files: run=1/1 failed=1
Result: FAILURE

The same build environnement with python3.11 work fine.
If I remove one of --without-doc-string or --enable-optimizations the build work fine.

build setup :

  • debian9
  • glibc2.24
./configure --enable-optimizations --without-doc-strings --with-lto=full --disable-test-modules \
    --with-computed-gotos --enable-shared  \
    --enable-loadable-sqlite-extensions --with-ssl-default-suites=openssl --with-openssl=/openssl-3.2.0/ \
    --with-openssl-rpath=auto

make PROFILE_TASK="-m test.regrtest --pgo -j$CORE_NB" -j$CORE_NB;

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Activity

Eclips4

Eclips4 commented on May 16, 2025

@Eclips4
Member

Hello!
I guess this is fixed by cc39b19, could you please try it on current 3.13 branch (not 3.13.3)?

added
pendingThe issue will be closed if no feedback is provided
on May 16, 2025
vincentpichon

vincentpichon commented on May 19, 2025

@vincentpichon
Author

Yep, it's working with the current 3.13 branch. Thank you.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Python3.13.3: test_functools fail during build with --enable-optimization and --without-docs-string · Issue #134092 · python/cpython

      Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

      Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant