classification
Title: Bad behavior with "restart \" or "restart "" in pdb
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: iritkatriel, j-rewerts, ppperry
Priority: normal Keywords: patch

Created on 2018-07-28 23:24 by ppperry, last changed 2021-06-10 21:50 by iritkatriel.

Pull Requests
URL Status Linked Edit
PR 26656 open iritkatriel, 2021-06-10 21:50
Messages (7)
msg322595 - (view) Author: (ppperry) Date: 2018-07-28 23:24
(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")
msg322596 - (view) Author: (ppperry) Date: 2018-07-28 23:26
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
msg322600 - (view) Author: Jared (j-rewerts) * Date: 2018-07-29 01:30
I wouldn't mind taking a look at this. Feel free to assign it to me!
msg322601 - (view) Author: (ppperry) Date: 2018-07-29 01:37
`restart "` also crashes with the same tb
msg322602 - (view) Author: Jared (j-rewerts) * Date: 2018-07-29 02:34
Would it be possible to escape both of those?

For the first one, restart "\\"

and for the second one, restart "\""
msg322603 - (view) Author: (ppperry) Date: 2018-07-29 02:37
Both of those work and don't produce an error
msg322604 - (view) Author: Jared (j-rewerts) * Date: 2018-07-29 02:46
Good!

Is it possible to start a python program with either \ or " as arguments normally (without using character escaping)?
History
Date User Action Args
2021-06-10 21:50:37iritkatrielsetkeywords: + patch
nosy: + iritkatriel

pull_requests: + pull_request25242
stage: patch review
2018-07-29 02:46:15j-rewertssetmessages: + msg322604
2018-07-29 02:37:03ppperrysetmessages: + msg322603
2018-07-29 02:34:27j-rewertssetmessages: + msg322602
2018-07-29 01:37:58ppperrysetmessages: + msg322601
title: Bad behavior with "restart \" in pdb -> Bad behavior with "restart \" or "restart "" in pdb
2018-07-29 01:30:53j-rewertssetnosy: + j-rewerts
messages: + msg322600
2018-07-28 23:26:28ppperrysetmessages: + msg322596
2018-07-28 23:24:25ppperrycreate