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 โ€” (๐Ÿž) Column marker in error message off for certain string errors ยท Issue #102312 ยท python/cpython

(๐Ÿž) Column marker in error message off for certain string errors #102312

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
(๐Ÿž) Column marker in error message off for certain string errors#102312
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@KotlinIsland
KotlinIsland
opened on Feb 28, 2023
Issue body actions
"\N{a}"
๐Ÿ‘‰ python test.py
  File "/test.py", line 1
    "\N{a}"
           ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-4: unknown Unicode character name

Here the caret is pointing to blackspace after the code

Expected

๐Ÿ‘‰ python test.py
  File "/test.py", line 1
    "\N{a}"
        ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-4: unknown Unicode character name
Reacted by DetachHead and Oleg Iarygin

Activity

  1. KotlinIsland
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Feb 28, 2023
  2. arhadthedev
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Feb 28, 2023
  3. arhadthedev commented on Feb 28, 2023

    @arhadthedev
    arhadthedev
    on Feb 28, 2023
    Member
    More actions

    Reproduced in the CLI too:

    >>> "\N{a}"
      File "<stdin>", line 1
        "\N{a}"
               ^
    SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-4: unknown Unicode character name

    By the way, the interpreter hangs for around five seconds on first execution of \N{a} with no delay on further attempts.

    Reacted by KotlinIsland
  4. KotlinIsland commented on Feb 28, 2023

    @KotlinIsland
    KotlinIsland
    on Feb 28, 2023
    ContributorAuthor
    More actions

    @arhadthedev Am I missing something? I Can't see any caret in your repro.

  5. arhadthedev commented on Feb 28, 2023

    @arhadthedev
    arhadthedev
    on Feb 28, 2023
    Member
    More actions

    @KotlinIsland Thank you, updated my initially undercopied output.

    Reacted by KotlinIsland
  6. arhadthedev commented on Feb 28, 2023

    @arhadthedev
    arhadthedev
    on Feb 28, 2023
    Member
    More actions

    @benjaminp, @pablogsal (as parser experts)

    update: @gvanrossum, @lysnikolaou (as new parser experts)

  7. terryjreedy commented on Feb 28, 2023

    @terryjreedy
    terryjreedy
    on Feb 28, 2023
    Member
    More actions

    This is likely a duplicate of #102310.
    Testing with Python 3.12.0a5+ (heads/main:0f89acf6cc, Feb 27 2023, 21:33:28), message is "incomplete input" and closing quote is marked. I interpret this as having been fixed already.
    EDIT: the different message is because I initially ran in IDLE, which uses codeop, which uses compile slightly differently.
    Get same messages in REPL compiled 2 hours ago and in installed 3.12.0a5 and installed 3.10.10.

  8. terryjreedy
    closed this as not plannedon Feb 28, 2023
  9. gvanrossum commented on Feb 28, 2023

    @gvanrossum
    gvanrossum
    on Feb 28, 2023
    Member
    More actions

    By the way, the interpreter hangs for around five seconds on first execution of \N{a} with no delay on further attempts.

    Could that just be importing the (humongous) unicodedata module to resolve the name?

    @terryjreedy What is it a duplicate of? Your link points to this same issue.

  10. gvanrossum commented on Feb 28, 2023

    @gvanrossum
    gvanrossum
    on Feb 28, 2023
    Member
    More actions

    PS. If Benjamin is still listed as parser expert that's likely out of date.

  11. arhadthedev
    moved this to Waiting Done in CPython pull requests to have finally mergedon Feb 28, 2023
  12. arhadthedev
    added this to CPython pull requests to have finally mergedon Feb 28, 2023
  13. terryjreedy commented on Feb 28, 2023

    @terryjreedy
    terryjreedy
    on Feb 28, 2023
    Member
    More actions

    #102310, about same problem with b"ฤ€". Sorry about bad link (now fixed).

  14. arhadthedev
    moved this from Waiting Done to Done in CPython pull requests to have finally mergedon Feb 28, 2023
  15. KotlinIsland commented on Feb 28, 2023

    @KotlinIsland
    KotlinIsland
    on Feb 28, 2023
    ContributorAuthor
    More actions

    I don't think it's the same issue as #102310, in that issue the column marker is offset by a non ascii character, in this issue the marker appears after the string. While this issue does make an appearance in #102310, I do feel that they are distinct.

    ๐Ÿ‘‰ $c:temp = "'\N{a}'"
    ๐Ÿ‘‰ py temp
      File "C:\temp", line 1
        '\N{a}'
               ^
    ๐Ÿ‘‰ $c:temp = "b'ฤ€'"
    ๐Ÿ‘‰ py temp
      File "C:\temp", line 1
        b'ฤ€'
             ^
    ๐Ÿ‘‰ $c:temp = "b'ฤ€ฤ€ฤ€ฤ€ฤ€ฤ€ฤ€ฤ€'"
    ๐Ÿ‘‰ py temp
      File "C:\temp", line 1
        b'ฤ€ฤ€ฤ€ฤ€ฤ€ฤ€ฤ€ฤ€'
                           ^
    SyntaxError: bytes can only contain ASCII literal characters
    SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-4: unknown Unicode character name
    
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

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)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.