GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_cmd_line_script and test_embed, test_compileall, test_urllib fail if TMPDIR path is non-ASCII · Issue #93855 · python/cpython

test_cmd_line_script and test_embed, test_compileall, test_urllib fail if TMPDIR path is non-ASCII #93855

New issue
Copy link
New issue
Copy link
Closed
Closed
test_cmd_line_script and test_embed, test_compileall, test_urllib fail if TMPDIR path is non-ASCII#93855
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@vstinner
vstinner
opened on Jun 15, 2022
Issue body actions
$ mkdir nonasciié
$ TMPDIR=$PWD/nonasciié/ TEMP=$PWD/nonasciié/ ./python -m test test_urllib -v -m test_file_notexists 
(...)
ERROR: test_file_notexists (test.test_urllib.urlopen_HttpTests.test_file_notexists)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/urllib/parse.py", line 1004, in _to_bytes
    url = url.encode("ASCII").decode()
          ^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 52: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_urllib.py", line 535, in test_file_notexists
    with urlopen(tmp_fileurl) as fobj:
         ^^^^^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/main/Lib/test/test_urllib.py", line 54, in urlopen
    return opener.open(url)
           ^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/main/Lib/urllib/request.py", line 1760, in open
    fullurl = unwrap(_to_bytes(fullurl))
                     ^^^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/main/Lib/urllib/parse.py", line 1006, in _to_bytes
    raise UnicodeError("URL " + repr(url) +
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeError: URL 'file://localhost//home/vstinner/python/main/nonasciié/tmp3e6una03' contains non-ASCII characters

cc @serhiy-storchaka

Activity

  1. vstinner
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 15, 2022
  2. vstinner commented on Jun 15, 2022

    @vstinner
    vstinner
    on Jun 15, 2022
    MemberAuthor
    More actions

    The following tests fail with non-ASCII TMPDIR:

    • test_urllib:

      • test_file_notexists()
    • test_embed:

      • test_init_pybuilddir()
    • test_compileall:

      • test_include_on_stdin()
      • test_include_on_stdin()
      • test_error()
    • test_cmd_line_script:

      • test_pep_409_verbiage()
      • test_syntaxerror_indented_caret_position()
      • test_syntaxerror_unindented_caret_position()
  3. vstinner
    changed the title [-]test_urllib: test_file_notexists() fails if TMPDIR path is non-ASCII[/-] [+]test_cmd_line_script and test_embed, test_compileall, test_urllib fail if TMPDIR path is non-ASCII[/+] on Jun 15, 2022
  4. vstinner commented on Jun 16, 2022

    @vstinner
    vstinner
    on Jun 16, 2022
    MemberAuthor
    More actions

    I merged my PR #93909 to create the temporary directory in /tmp but with an ASCII name. Once this issue will be fixed, we can add again os_helper.FS_NONASCII suffix to the temporary directory name to detect such bug.

  5. vstinner commented on Nov 3, 2022

    @vstinner
    vstinner
    on Nov 3, 2022
    MemberAuthor
    More actions

    Sadly, I don't have the bandwidth to work on this issue, so I just close it.

  6. vstinner
    closed this as completedon Nov 3, 2022
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

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.