[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-25 Thread Barun Parruck

Barun Parruck added the comment:

I just changed the ValueError to TypeError. This is my first attempt at fixing 
anything, so let me know if I've screwed up anywhere.

--
keywords: +patch
nosy: +Barun Parruck
Added file: http://bugs.python.org/file41712/typeerror.patch

___
Python tracker 
<http://bugs.python.org/issue26198>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-25 Thread Barun Parruck

Barun Parruck added the comment:

Added a patch that changes the documentation to reflect TypeError instead of 
ValueError*

--

___
Python tracker 
<http://bugs.python.org/issue26198>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-26 Thread Barun Parruck

Barun Parruck added the comment:

I'll take a look at it! :) Would you like unit tests as well?

--
nosy: +Barun Parruck

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-26 Thread Barun Parruck

Barun Parruck added the comment:

Hi, to check if I've done things right, which functions did you try out dis.dis 
on?

--

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-26 Thread Barun Parruck

Barun Parruck added the comment:

Allright, so I'm uploading a preliminary patch, please look through it to see 
if I understood what you meant me to do about dis.findlabels.

The tests seem to mostly pass, except oddly enough, urlstdlib2, which is 
probably system-specific?

I get the correct output that you specify for that particular test function.

I'll see about building a unit test.

--

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-26 Thread Barun Parruck

Barun Parruck added the comment:

The patch I forgot to attach. Ha ha.

--
keywords: +patch
Added file: http://bugs.python.org/file42035/preliminarypatch.diff

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-26 Thread Barun Parruck

Barun Parruck added the comment:

Hi, I'm a little confused as to how to write a test using bytecode 
streams...probably due to my lack of clarity as to what exactly dis.disassemble 
does. Is there any way you could give me a bit more information? :)

--

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-26 Thread Barun Parruck

Barun Parruck added the comment:

Hi, yes, that works much better, and I've definitely understood!

Now, about the tests, how large would you like them to be? For instance :

code = bytes (
chr(opmap["JUMP_FORWARD"]) + chr(0) + chr(255) + 
chr(EXTENDED_ARG) + chr(1) + chr(1) + 
chr(opmap["JUMP_FORWARD"]) + chr(0) + chr(0) +
chr(EXTENDED_ARG) + chr(1) + chr(0) +
chr(opmap["JUMP_ABSOLUTE"]) + chr(0) + chr(1) +
chr(opmap["RETURN_VALUE"]),
encoding="latin-1"
)

Would return [65283, 16842761, 65792]

And I'll make sure I test all the jump instances (I'm shuddering to imagine 
what a real computer would do if fed with those byte codes)

Do you want the tests to be large? (array size > 10^2/2 as a result), or is the 
example above fine, if I add three or four more example testing each jump 
instance?

--

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-27 Thread Barun Parruck

Barun Parruck added the comment:

Four test cases have been included in the unittests, using the module unittest. 
One is the original one you gave me, the others are some that I played around 
with it, and thought would be useful to include.

I would love some code reviews at this point!

--
Added file: http://bugs.python.org/file42037/testfindlabels.py

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-27 Thread Barun Parruck

Barun Parruck added the comment:

Sorry, the previous file had a bug.

--
Added file: http://bugs.python.org/file42038/testfindlabels2.py

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-28 Thread Barun Parruck

Barun Parruck added the comment:

Hi, sorry, been pretty busy, and will be for a few days, so my replies may not 
be instant!

Having looked through the dis test module, to be honest, I can't even find a 
call to dis.findlabels...odd. Maybe I've got it wrong, and I wouldn't mind 
somebody else taking a look! But either way, a quick overview shows me that it 
basically picks up functions, figures out the disassembled function, and 
compares expected output, in a similar way that we're working, actually. 

I'll look through your example, which looks pretty good! It works as expected 
on my repo (fails and passes appropriately), and I'll see about improving it, 
but for now, it seems to do its job.

--

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-03-02 Thread Barun Parruck

Barun Parruck added the comment:

So...firstly hi, and sorry for disappearing like that!

You want tests for the dis.findlabels library? What sort of tests are you 
looking for? Similiarly sized bytecode streams like the ones we worked with, or 
did you have something else in mind?

B

--

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-03-11 Thread Barun Parruck

Barun Parruck added the comment:

Hi!

Okay, sorry for disappearing like that(this is becoming rather a habit isn't 
it!), but with Gsoc applications, I've been insanely busy trying to get patches 
and bugs accepted for my first Gsoc ever. I do apologize for leaving you 
hanging, it was not my intention!

I'll try my best to give you an update by the end of this week and hopefully be 
able to keep working on this!

--

___
Python tracker 
<http://bugs.python.org/issue26448>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com