Skip to content

regrtest can fail writing unencodable test description or status #135124

Closed
@serhiy-storchaka

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

added
stdlibPython modules in the Lib dir
3.13bugs and security fixes
3.14bugs and security fixes
3.15new features, bugs and security fixes
on Jun 4, 2025
serhiy-storchaka

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.

serhiy-storchaka

serhiy-storchaka commented on Jun 4, 2025

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

pythongh-135124: Change stdout errors in regrtest worker process

pythongh-135124: Change stdout errors in regrtest worker process

pythongh-135124: Change stdout errors in regrtest worker process

vstinner

vstinner commented on Jun 4, 2025

@vstinner
Member

I proposed #135138 to fix the issue.

11 remaining items

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.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibPython modules in the Lib dirtestsTests 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

      regrtest can fail writing unencodable test description or status · Issue #135124 · 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