Skip to content

pdb unintentionally interpolates strings with convenience variables #112343

Closed

Description

@salty-horse

Bug report

Bug description:

Python 3.12 introduced $-prefixed convenience variables to pdb (#103693).

It automatically replaces $-words in strings, which is undocumented. @nedbat suggests this is unintended behavior.

(Pdb) p '$in'
'__pdb_convenience_variables["in"]'

This totally breaks MongoDB queries inside pdb, as it makes frequent use of such strings.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Activity

  1. gaogaotiantian commented on Nov 24, 2023

    @gaogaotiantian
    Member

    PR #112380 made to fix this. We can't easily achieve this with pure regex so I simply switched to tokenize.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Nov 26, 2023
  3. added a commit that references this issue on Jan 17, 2024
  4. added 4 commits that reference this issue on Jan 17, 2024
  5. added a commit that references this issue on Jan 17, 2024
  6. added a commit that references this issue on Jan 22, 2024
  7. gaogaotiantian commented on Feb 5, 2024

    @gaogaotiantian
    Member

    This is fixed in main and backported to 3.12. Close.

  8. added a commit that references this issue on Feb 11, 2024
  9. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions