hwms / jrfonseca

Automatically exported from code.google.com/p/jrfonseca
0 stars 0 forks source link

error with read_number() function #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. on OSX using w3af itwill throw an error about:
File 
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/xdot.py", line 494, in read_number
    return int(self.read_code())

Upon opening the file i located the function read_number(). It is typcasting to 
an int from a string, therefore failing.

to fix this I modified the function from:

    def read_number(self):
            return int(self.read_code())

to:

    def read_number(self):
            return int(float(self.read_code()))

It now evaluates the string, to a float first, then to an int()

if you need any more information please contact me at vekt0r@me.com

Original issue reported on code.google.com by twisted....@gmail.com on 1 Mar 2014 at 2:29

GoogleCodeExporter commented 9 years ago
have also seen this causing errors with other packages besides w3af while 
researching a fix

apologies I have never coded in Python before however the fix produces expected 
results as far as I can see.

modified xdot.py attached

Tom Hyde
vekt0r(at)me(d.ot)com

Original comment by twisted....@gmail.com on 1 Mar 2014 at 2:38

Attachments:

GoogleCodeExporter commented 9 years ago
See https://github.com/andresriancho/w3af/issues/1327

Original comment by andres.riancho@gmail.com on 6 Mar 2014 at 1:00

GoogleCodeExporter commented 9 years ago
This should be fixed in 
https://github.com/jrfonseca/xdot.py/commit/e36b49b2b0b5038515bd4479fe119d92d3e2
719d

Original comment by Jose.R.F...@gmail.com on 10 Mar 2014 at 1:39