Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#2065 closed bug (Fixed)

Tested - [Console] Crash upon forgetting closing quote

Reported by: nogare Owned by: Cas
Priority: trivial Milestone: 1.3.6
Component: Console UI Version: 1.3-stable (git)
Keywords: Cc:

Description

>>> rm --remove_data foo"                                                                                                    
rm --remove_data T[ERROR   ] 15:31:31 screen:307 No closing quotation                                                                                 
                                                                     Traceback (most recent call last):
                                                                    File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.4_dev-py2.6.egg/deluge/ui/console/screen.py", line 305, in doRead self._doRead()
File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.4_dev-py2.6.egg/deluge/ui/console/screen.py", line 318, in _doRead self.command_parser(self.input.encode(self.encoding))
File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.4_dev-py2.6.egg/deluge/ui/console/main.py", line 299, in do_command
args = self._commands[cmd].split(line)
                                                               File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.4_dev-py2.6.egg/deluge/ui/console/main.py", line 115, in split
return shlex.split(text)
                                                                  File "/usr/lib/python2.6/shlex.py", line 279, in split
return list(lex)
                                                                    File "/usr/lib/python2.6/shlex.py", line 269, in next token = self.get_token()
                                                                 File "/usr/lib/python2.6/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib/python2.6/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation

If you type a command say rm --remove_data "foo bar and hit enter console dies. Instead the user should be informed that they forgot to add a closing quotation.

Attachments (2)

patch (666 bytes) - added by Dan39 6 years ago.
patch
gitmasterpatch (714 bytes) - added by Dan39 6 years ago.
patch for git master deluge/ui/console/legacy.py

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by Dan39

patch

comment:1 Changed 6 years ago by Dan39

here we go :D

attached patch

comment:2 Changed 6 years ago by nogare

  • Summary changed from [Console] Crash upon forgetting closing quote to Tested - [Console] Crash upon forgetting closing quote

Tested this patch with 1.3.5 and it works fine.

Dan39; could you generate a .patch for deluge/ui/console/modes/legacy.py (which you will find in git master) The same code should work.

comment:3 Changed 6 years ago by Cas

  • Milestone changed from Future to 1.3.6
  • Owner set to Cas
  • Status changed from new to assigned

Changed 6 years ago by Dan39

patch for git master deluge/ui/console/legacy.py

comment:4 Changed 6 years ago by Dan39

been a whole week... but here you :P

(yea i put wrong path for description of attachment... o well doesn't matter :P)

comment:5 Changed 5 years ago by nogare

Cas: Tested on git master and it fixes the problem. Once these patch's have been applied this ticket can be closed

comment:6 Changed 5 years ago by nogare

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed.

comment:7 Changed 5 years ago by Cas

  • Type changed from defect to bug

1.3-stable: 483c439e385

Note: See TracTickets for help on using tickets.