Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_doctest fails with non-ascii path #51916

Closed
florentx mannequin opened this issue Jan 10, 2010 · 4 comments
Closed

test_doctest fails with non-ascii path #51916

florentx mannequin opened this issue Jan 10, 2010 · 4 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@florentx
Copy link
Mannequin

florentx mannequin commented Jan 10, 2010

BPO 7667
Nosy @vstinner, @florentx
Files
  • test_doctest.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/florentx'
    closed_at = <Date 2010-02-27.14:42:32.189>
    created_at = <Date 2010-01-10.18:11:52.528>
    labels = ['type-bug', 'tests']
    title = 'test_doctest fails with non-ascii path'
    updated_at = <Date 2010-03-22.22:46:27.553>
    user = 'https://github.com/florentx'

    bugs.python.org fields:

    activity = <Date 2010-03-22.22:46:27.553>
    actor = 'flox'
    assignee = 'flox'
    closed = True
    closed_date = <Date 2010-02-27.14:42:32.189>
    closer = 'flox'
    components = ['Tests']
    creation = <Date 2010-01-10.18:11:52.528>
    creator = 'flox'
    dependencies = []
    files = ['15962']
    hgrepos = []
    issue_num = 7667
    keywords = ['patch', 'buildbot']
    message_count = 4.0
    messages = ['97533', '98099', '100183', '101545']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'flox']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue7667'
    versions = ['Python 2.7']

    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Jan 10, 2010

    /tmp/py2u…→unicode $ ./python Lib/test/regrtest.py test_doctest
    test_doctest


    File "/tmp/py2u…→unicode/Lib/test/test_doctest.py", line 2052, in test.test_doctest.test_DocFileSuite
    Failed example:
    suite.run(unittest.TestResult())
    Expected:
    <unittest.result.TestResult run=3 errors=0 failures=2>
    Got:
    <unittest.result.TestResult run=3 errors=2 failures=0>


    1 items had failures:
    1 of 40 in test.test_doctest.test_DocFileSuite
    ***Test Failed*** 1 failures.
    test test_doctest failed -- 1 of 421 doctests failed

    1 test failed:
    test_doctest

    @florentx florentx mannequin added the tests Tests in the Lib/test dir label Jan 10, 2010
    @vstinner
    Copy link
    Member

    There are 2 different issues:

    • doctest.DocTestRunner.report_failure() raise an unicode error if the source line type is unicode: _failure_header() should convert the line to bytes using ASCII with backslashreplace error handler (as sys.stderr)
    • traceback.print_tb() raises an unicode error if the source line type is unicode: same solution (ASCII+bashslashreplace)

    See also #bpo-7708.

    @florentx florentx mannequin self-assigned this Feb 26, 2010
    @florentx florentx mannequin added the type-bug An unexpected behavior, bug, or error label Feb 26, 2010
    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Feb 27, 2010

    It should be fixed with patch attached to bpo-1729305.

    @florentx florentx mannequin closed this as completed Feb 27, 2010
    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Mar 22, 2010

    Really fixed with r79307.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant