Ticket #392 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Umit Crash - 'not enough arguments for format string'

Reported by: jhonny699@… Owned by: diogo
Priority: medium Milestone: Umit 1.0RC
Component: CrashReport Version: current svn
Keywords: user crash Cc:

Description (last modified by diogo) (diff)

Crash Report
==========

sys.platform linux2
os.name posix
Gtk version 2.18.3
Umit version 1.0RC

Description


Versions:
---
GTK: 2.18.3
PyGTK: 2.18.0
HIGWidgets: 1.0RC
Python: 2.6.4 (r264:75706, Dec  7 2009, 18:45:15) 
[GCC 4.4.1]
Nmap: Nmap version 5.00 ( http://nmap.org )
Operating System: Linux gianfranco-laptop 2.6.31-21-generic-pae #59-Ubuntu SMP Wed Mar 24 08:47:55 UTC 2010 i686
Umit: 1.0RC
UmitCore: 1.0RC
UmitGUI: 1.0RC
---
<type 'exceptions.TypeError'>
Python 2.6.4: /usr/bin/python
Tue May  4 18:23:55 2010

A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /usr/share/umit/umit/gui/Wizard.py in save_profile(self=<Wizard object at 0xa041d24 (GtkWindow at 0xa1062d0)>, widget=<HIGButton object at 0xa21f414 (GtkButton at 0xa2662f0)>)
  365         elif self.notebook:
  366             target = self.directions['Choose'].target_entry.get_text()
  367             cmd = command % target
  368 
  369             current_page = self.notebook.get_nth_page(\
cmd undefined
command = u'nmap -sL -p%s -sW -T Aggressive --packet-trace %s'
target = 'www.mps.it'
<type 'exceptions.TypeError'>: not enough arguments for format string
    __class__ = <type 'exceptions.TypeError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.TypeError object at 0xa228f0c>
    __dict__ = {}
    __doc__ = 'Inappropriate argument type.'
    __format__ = <built-in method __format__ of exceptions.TypeError object at 0xa228f0c>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.TypeError object at 0xa228f0c>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.TypeError object at 0xa228f0c>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.TypeError object at 0xa228f0c>
    __hash__ = <method-wrapper '__hash__' of exceptions.TypeError object at 0xa228f0c>
    __init__ = <method-wrapper '__init__' of exceptions.TypeError object at 0xa228f0c>
    __new__ = <built-in method __new__ of type object at 0x821cf80>
    __reduce__ = <built-in method __reduce__ of exceptions.TypeError object at 0xa228f0c>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.TypeError object at 0xa228f0c>
    __repr__ = <method-wrapper '__repr__' of exceptions.TypeError object at 0xa228f0c>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.TypeError object at 0xa228f0c>
    __setstate__ = <built-in method __setstate__ of exceptions.TypeError object at 0xa228f0c>
    __sizeof__ = <built-in method __sizeof__ of exceptions.TypeError object at 0xa228f0c>
    __str__ = <method-wrapper '__str__' of exceptions.TypeError object at 0xa228f0c>
    __subclasshook__ = <built-in method __subclasshook__ of type object at 0x821cf80>
    __unicode__ = <built-in method __unicode__ of exceptions.TypeError object at 0xa228f0c>
    args = ('not enough arguments for format string',)
    message = 'not enough arguments for format string'

The above is a description of an error in a Python program.  Here is
the original traceback:

Traceback (most recent call last):
  File "/usr/share/umit/umit/gui/Wizard.py", line 367, in save_profile
    cmd = command % target
TypeError: not enough arguments for format string


Attachments

ticket_392_1.patch (1.9 kB) - added by diogo 3 years ago.
ticket_392_2.patch (2.4 kB) - added by diogo 3 years ago.

Change History

  Changed 3 years ago by diogo

  • owner changed from boltrix to diogo
  • description modified (diff)

Changed 3 years ago by diogo

  Changed 3 years ago by diogo

  • status changed from new to closed
  • resolution set to fixed

The patch that i submitted, shows a popup message when the command is wrong, avoiding that the program exits with an exception.

  Changed 3 years ago by luis

  • status changed from closed to reopened
  • resolution fixed deleted

The ticket is not closed yet. It should be closed when a proper solution was commited in repository and then linked with the ticket.

follow-up: ↓ 5   Changed 3 years ago by getxsick

Could you please do not mix tabs/space indents?

Changed 3 years ago by diogo

in reply to: ↑ 4   Changed 3 years ago by diogo

Replying to getxsick:

Could you please do not mix tabs/space indents?

Now the patch only have space indents.

  Changed 3 years ago by diogo

Steps to reproduce the bug:

NMap Command Constructor Wizard -> Novice -> Command (insert some target)

Select options "Ports to Scan" and write "%s" as the port number. In the final of the wizard when applying, the bug happens.

  Changed 3 years ago by luis

The patch was already tested and it is working. Can you do commit?

  Changed 3 years ago by diogo

  • status changed from reopened to closed
  • resolution set to fixed

Patch applied

  Changed 3 years ago by luis

in r5859

Note: See TracTickets for help on using tickets.