Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 655
    • Issues 655
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPy
  • pypypypy
  • Merge requests
  • !736

Merged
Created Jun 28, 2020 by Yannick Jadoul@YannickJadoulMaintainer

Implement bpo-29104: Fixed parsing backslashes in f-strings

  • Overview 4
  • Commits 2
  • Pipelines 3
  • Changes 3

This fixed (should fix) the failure in test_backslashes_in_string_part in test_fstring.

Currently, it seems this is even causing undefined behavior, reading some memory somewhere that should not be read. If you try f'\{42}' in Python 3.6, PyPy 7.3.0, this comes out:

>>>> f'\{42}'
'\\\x0042'
>>>> f'\{42}'
'\\c42'
>>>> f'\{42}'
'\\\x9c42'
>>>> f'\{42}'
'\\\x0042'
>>>> f'\{42}'
'\\ì42'
>>>> f'\{42}'
'\x0b42'
>>>> f'\{42}'
'\\\x8242'
>>>> f'\{42}'
'\\\x0042'
>>>> f'\{42}'
'\\\x1742'

See https://bugs.python.org/issue29104 & https://github.com/python/cpython/pull/490 (& https://github.com/python/cpython/pull/1812, backported to 3.6)

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: topic/py3.6/py3.6-bpo-29104