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
    type-bug
    on Jun 4, 2025
  2. added
    stdlib
    3.13
    3.14
    3.15
    on Jun 4, 2025
  3. 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.

  4. serhiy-storchaka commented on Jun 4, 2025

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

    @vstinner
    Member

    I proposed #135138 to fix the issue.

  7. added
    tests
    on Jun 4, 2025
  8. 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
  9. added a commit that references this issue on Jun 5, 2025
  10. added 2 commits that reference this issue on Jun 5, 2025
  11. added 2 commits that reference this issue on Jun 5, 2025
  12. added a commit that references this issue on Jul 12, 2025
  13. added a commit that references this issue on Aug 4, 2025
  14. 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.133.143.15stdlibteststopic-unicodetype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions