Skip to content

regrtest can fail writing unencodable test description or status #135124

Closed

Description

@serhiy-storchaka

Bug report

I already fixed errors related to non-ASCII skip messages (by using ascii() instead of str() or repr()). There may be other non-ASCII skip messages left, but they are not raised on buildbots with non-UTF-8 stdout. In any case, this only fixed CPython tests, user tests can have the same issues.

#135121 exposed a new issue -- subtest description which includes non-ASCII parameter values. It is more difficult, because we have no control on formatting them. Always using ascii() instead of repr() will harm readability on normal platforms.

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    3.13only security fixes
    3.14bugs and security fixes
    3.15bugs and security fixes
    on Jun 4, 2025
  2. serhiy-storchaka commented on Jun 4, 2025

    @serhiy-storchaka
    MemberAuthor

    The following tests passes in unittest and in libregrtest with a single process, but fails in libregrtest with multiple processes.

    import unittest
    class TestNonASCII(unittest.TestCase):
        def test_docstring(self):
            """\u20ac"""
        def test_subtest(self):
            with self.subTest(param='\u20ac'):
                pass
        def test_skip(self):
            self.skipTest('\u20ac')

    When run with unittest, the output stream is stderr with the backslashreplace error handler. In libregrtest with a single process, the output stream is stdout with the backslashreplace error handler, but in multi-process mode -- with the strict error handler.

  3. serhiy-storchaka commented on Jun 4, 2025

    @serhiy-storchaka
    MemberAuthor
  4. added 3 commits that reference this issue on Jun 4, 2025
  5. vstinner commented on Jun 4, 2025

    @vstinner
    Member

    I proposed #135138 to fix the issue.

  6. changed the title [-]unittest can fail writing unencodable test description or status[/-] [+]regrtest can fail writing unencodable test description or status[/+] on Jun 4, 2025
  7. added a commit that references this issue on Jun 5, 2025
  8. added 2 commits that reference this issue on Jun 5, 2025
  9. added 2 commits that reference this issue on Jun 5, 2025
  10. added a commit that references this issue on Jul 12, 2025
  11. added a commit that references this issue on Aug 4, 2025
  12. added a commit that references this issue on Aug 19, 2025
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

    3.13only security fixes3.14bugs and security fixes3.15bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirtopic-unicodetype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions