Oh i see, thanks for explaining Curt. I should have dug a little deeper myself, but usually its me doing something stupid and not a bug. I assumed it was my fault =) I'll open a ticket.<br><br><div class="gmail_quote">
On 29 December 2011 16:15, Curt Hagenlocher <span dir="ltr"><<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>This looks like a bug in IronPython when deriving a class from int. Here's a simple repro; file a bug!</div><div> </div><div>In IronPython 2.7.1,</div><div> </div><div>>>> class Integer(int):<br>... def __init__(self, value):<br>
... int.__init__(value)<br>...<br>>>> Integer(10)<br>10<br>>>> Integer('10')<div class="im"><br>Traceback (most recent call last):<br></div> File "<stdin>", line 1, in <module><div class="im">
<br>TypeError: expected int, got str<br></div>
>>> int('10')<br>10<br>>>></div><div> </div><div>In Python 2.6,</div><div>>>> class Integer(int):<br>... def __init__(self, value):<br>... int.__init__(value)<br>...<br>>>> Integer(10)<br>
10<br>>>> Integer('10')<br>10<br>>>> int('10')<br>10<br>>>><br></div><div class="gmail_quote"><div><div class="h5">On Thu, Dec 29, 2011 at 7:30 AM, Chris <span dir="ltr"><<a href="mailto:phatfish@gmail.com" target="_blank">phatfish@gmail.com</a>></span> wrote:<br>
</div></div><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div><div class="h5"><div>Hi,</div><div> </div>
<div>Can anyone explain this bellow. Does PyPDF use some unsported part of the standard lib? Because there are no external modules required for it.</div>
<div>On another note, is there a way for the "Execute Project in Python Interactive" to use the vanilla Python interpreter rather than the IronPython one. I cant see a way to change this?</div>
<div> </div><div>Thanks</div><div> </div><div><b>Python 2.7 Interactive Window</b></div><div> </div><div> Resetting execution engine<br>>>> from pyPdf import PdfFileReader<br>>>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short numbers/2370.pdf', 'rb'))<br>
>>> print 'test'<br>test<br>>>> </div><div> </div><div><b>IronPython 2.7 Interactive Window</b></div><div> </div><div>>>> from pyPdf import PdfFileReader<br>>>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short numbers/2370.pdf', 'rb'))<br>
Traceback (most recent call last):<br> File "<string>", line 1, in <module><br> File "C:\Program Files (x86)\IronPython 2.7.1\lib\site-packages\pyPdf\pdf.py", line 374, in __init__<br> self.read(stream)<br>
File "C:\Program Files (x86)\IronPython 2.7.1\lib\site-packages\pyPdf\pdf.py", line 732, in read<br> num = readObject(stream, self)<br> File "C:\Program Files (x86)\IronPython 2.7.1\lib\site-packages\pyPdf\generic.py", line 87, in readObject<br>
return NumberObject.readFromStream(stream)<br> File "C:\Program Files (x86)\IronPython 2.7.1\lib\site-packages\pyPdf\generic.py", line 236, in readFromStream<br> return NumberObject(name)<br>TypeError: expected int, got str<br>
>>> </div>
<br></div></div><div class="im">_______________________________________________<br>
Ironpython-users mailing list<br>
<a href="mailto:Ironpython-users@python.org" target="_blank">Ironpython-users@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">http://mail.python.org/mailman/listinfo/ironpython-users</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>