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

Bad behavior with "restart \" or "restart "" in pdb #78447

Closed
pppery mannequin opened this issue Jul 28, 2018 · 10 comments
Closed

Bad behavior with "restart \" or "restart "" in pdb #78447

pppery mannequin opened this issue Jul 28, 2018 · 10 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 bug and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@pppery
Copy link
Mannequin

pppery mannequin commented Jul 28, 2018

BPO 34266
Nosy @pppery, @miss-islington, @j-rewerts, @iritkatriel
PRs
  • bpo-34266: [pdb] handle ValueError from shlex.split() #26656
  • [3.9] bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) #27005
  • [3.10] bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) #27006
  • 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 = None
    closed_at = <Date 2021-07-03.16:29:03.216>
    created_at = <Date 2018-07-28.23:24:25.171>
    labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
    title = 'Bad behavior with "restart \\" or "restart "" in pdb'
    updated_at = <Date 2021-07-03.16:29:03.216>
    user = 'https://github.com/pppery'

    bugs.python.org fields:

    activity = <Date 2021-07-03.16:29:03.216>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-07-03.16:29:03.216>
    closer = 'iritkatriel'
    components = ['Library (Lib)']
    creation = <Date 2018-07-28.23:24:25.171>
    creator = 'ppperry'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34266
    keywords = ['patch']
    message_count = 10.0
    messages = ['322595', '322596', '322600', '322601', '322602', '322603', '322604', '396911', '396912', '396913']
    nosy_count = 4.0
    nosy_names = ['ppperry', 'miss-islington', 'j-rewerts', 'iritkatriel']
    pr_nums = ['26656', '27005', '27006']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue34266'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @pppery
    Copy link
    Mannequin Author

    pppery mannequin commented Jul 28, 2018

    (Pdb) restart \
    Traceback (most recent call last):
      File "C:\Program Files\Python36\lib\pdb.py", line 1667, in main
        pdb._runscript(mainpyfile)
      File "C:\Program Files\Python36\lib\pdb.py", line 1548, in _runscript
        self.run(statement)
      File "C:\Program Files\Python36\lib\bdb.py", line 431, in run
        exec(cmd, globals, locals)
      File "<string>", line 1, in <module>
      <code being debugged ommited>
      File "C:\Program Files\Python36\lib\bdb.py", line 48, in trace_dispatch
        return self.dispatch_line(frame)
      File "C:\Program Files\Python36\lib\bdb.py", line 66, in dispatch_line
        self.user_line(frame)
      File "C:\Program Files\Python36\lib\pdb.py", line 261, in user_line
        self.interaction(frame, None)
      File "C:\Program Files\Python36\lib\pdb.py", line 352, in interaction
        self._cmdloop()
      File "C:\Program Files\Python36\lib\pdb.py", line 321, in _cmdloop
        self.cmdloop()
      File "C:\Program Files\Python36\lib\cmd.py", line 138, in cmdloop
        stop = self.onecmd(line)
      File "C:\Program Files\Python36\lib\pdb.py", line 418, in onecmd
        return cmd.Cmd.onecmd(self, line)
      File "C:\Program Files\Python36\lib\cmd.py", line 217, in onecmd
        return func(arg)
      File "C:\Program Files\Python36\lib\pdb.py", line 1025, in do_run
        sys.argv = shlex.split(arg)
      File "C:\Program Files\Python36\lib\shlex.py", line 305, in split
        return list(lex)
      File "C:\Program Files\Python36\lib\shlex.py", line 295, in __next__
        token = self.get_token()
      File "C:\Program Files\Python36\lib\shlex.py", line 105, in get_token
        raw = self.read_token()
      File "C:\Program Files\Python36\lib\shlex.py", line 206, in read_token
        raise ValueError("No escaped character")

    @pppery pppery mannequin added 3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jul 28, 2018
    @pppery
    Copy link
    Mannequin Author

    pppery mannequin commented Jul 28, 2018

    Just to be clear, even though the traceback is python 3.6, the same bug occurs in 3.7 with an identical traceback except for some changes in line number

    @j-rewerts
    Copy link
    Mannequin

    j-rewerts mannequin commented Jul 29, 2018

    I wouldn't mind taking a look at this. Feel free to assign it to me!

    @pppery
    Copy link
    Mannequin Author

    pppery mannequin commented Jul 29, 2018

    restart " also crashes with the same tb

    @pppery pppery mannequin changed the title Bad behavior with "restart \" in pdb Bad behavior with "restart \" or "restart "" in pdb Jul 29, 2018
    @j-rewerts
    Copy link
    Mannequin

    j-rewerts mannequin commented Jul 29, 2018

    Would it be possible to escape both of those?

    For the first one, restart "\\"

    and for the second one, restart "\""

    @pppery
    Copy link
    Mannequin Author

    pppery mannequin commented Jul 29, 2018

    Both of those work and don't produce an error

    @j-rewerts
    Copy link
    Mannequin

    j-rewerts mannequin commented Jul 29, 2018

    Good!

    Is it possible to start a python program with either \ or " as arguments normally (without using character escaping)?

    @iritkatriel
    Copy link
    Member

    New changeset d968a63 by Irit Katriel in branch 'main':
    bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656)
    d968a63

    @iritkatriel iritkatriel added 3.9 only security fixes 3.10 only security fixes 3.11 bug and security fixes and removed 3.7 (EOL) end of life 3.8 only security fixes labels Jul 3, 2021
    @iritkatriel
    Copy link
    Member

    New changeset 21be6cb by Miss Islington (bot) in branch '3.9':
    bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27005)
    21be6cb

    @iritkatriel
    Copy link
    Member

    New changeset 33022f9 by Irit Katriel in branch '3.10':
    [3.10] bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27006)
    33022f9

    @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
    3.9 only security fixes 3.10 only security fixes 3.11 bug and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant