[Ironpython-users] PyPDF error
Hi,
Can anyone explain this bellow. Does PyPDF use some unsported part of the
standard lib? Because there are no external modules required for it.
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?
Thanks
*Python 2.7 Interactive Window*
Resetting execution engine
>>> from pyPdf import PdfFileReader
>>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short
numbers/2370.pdf', 'rb'))
>>> print 'test'
test
>>>
*IronPython 2.7 Interactive Window*
>>> from pyPdf import PdfFileReader
>>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short
numbers/2370.pdf', 'rb'))
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files (x86)\IronPython
2.7.1\lib\site-packages\pyPdf\pdf.py", line 374, in __init__
self.read(stream)
File "C:\Program Files (x86)\IronPython
2.7.1\lib\site-packages\pyPdf\pdf.py", line 732, in read
num = readObject(stream, self)
File "C:\Program Files (x86)\IronPython
2.7.1\lib\site-packages\pyPdf\generic.py", line 87, in readObject
return NumberObject.readFromStream(stream)
File "C:\Program Files (x86)\IronPython
2.7.1\lib\site-packages\pyPdf\generic.py", line 236, in readFromStream
return NumberObject(name)
TypeError: expected int, got str
>>>
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users
Re: [Ironpython-users] PyPDF error
This looks like a bug in IronPython when deriving a class from int. Here's
a simple repro; file a bug!
In IronPython 2.7.1,
>>> class Integer(int):
... def __init__(self, value):
... int.__init__(value)
...
>>> Integer(10)
10
>>> Integer('10')
Traceback (most recent call last):
File "", line 1, in
TypeError: expected int, got str
>>> int('10')
10
>>>
In Python 2.6,
>>> class Integer(int):
... def __init__(self, value):
... int.__init__(value)
...
>>> Integer(10)
10
>>> Integer('10')
10
>>> int('10')
10
>>>
On Thu, Dec 29, 2011 at 7:30 AM, Chris wrote:
> Hi,
>
> Can anyone explain this bellow. Does PyPDF use some unsported part of the
> standard lib? Because there are no external modules required for it.
> 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?
>
> Thanks
>
> *Python 2.7 Interactive Window*
>
> Resetting execution engine
> >>> from pyPdf import PdfFileReader
> >>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short
> numbers/2370.pdf', 'rb'))
> >>> print 'test'
> test
> >>>
>
> *IronPython 2.7 Interactive Window*
>
> >>> from pyPdf import PdfFileReader
> >>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short
> numbers/2370.pdf', 'rb'))
> Traceback (most recent call last):
> File "", line 1, in
> File "C:\Program Files (x86)\IronPython
> 2.7.1\lib\site-packages\pyPdf\pdf.py", line 374, in __init__
> self.read(stream)
> File "C:\Program Files (x86)\IronPython
> 2.7.1\lib\site-packages\pyPdf\pdf.py", line 732, in read
> num = readObject(stream, self)
> File "C:\Program Files (x86)\IronPython
> 2.7.1\lib\site-packages\pyPdf\generic.py", line 87, in readObject
> return NumberObject.readFromStream(stream)
> File "C:\Program Files (x86)\IronPython
> 2.7.1\lib\site-packages\pyPdf\generic.py", line 236, in readFromStream
> return NumberObject(name)
> TypeError: expected int, got str
> >>>
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users
Re: [Ironpython-users] PyPDF error
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.
On 29 December 2011 16:15, Curt Hagenlocher wrote:
> This looks like a bug in IronPython when deriving a class from int. Here's
> a simple repro; file a bug!
>
> In IronPython 2.7.1,
>
> >>> class Integer(int):
> ... def __init__(self, value):
> ... int.__init__(value)
> ...
> >>> Integer(10)
> 10
> >>> Integer('10')
>
> Traceback (most recent call last):
> File "", line 1, in
>
> TypeError: expected int, got str
> >>> int('10')
> 10
> >>>
>
> In Python 2.6,
> >>> class Integer(int):
> ... def __init__(self, value):
> ... int.__init__(value)
> ...
> >>> Integer(10)
> 10
> >>> Integer('10')
> 10
> >>> int('10')
> 10
> >>>
> On Thu, Dec 29, 2011 at 7:30 AM, Chris wrote:
>
>> Hi,
>>
>> Can anyone explain this bellow. Does PyPDF use some unsported part of the
>> standard lib? Because there are no external modules required for it.
>> 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?
>>
>> Thanks
>>
>> *Python 2.7 Interactive Window*
>>
>> Resetting execution engine
>> >>> from pyPdf import PdfFileReader
>> >>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short
>> numbers/2370.pdf', 'rb'))
>> >>> print 'test'
>> test
>> >>>
>>
>> *IronPython 2.7 Interactive Window*
>>
>> >>> from pyPdf import PdfFileReader
>> >>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short
>> numbers/2370.pdf', 'rb'))
>> Traceback (most recent call last):
>> File "", line 1, in
>> File "C:\Program Files (x86)\IronPython
>> 2.7.1\lib\site-packages\pyPdf\pdf.py", line 374, in __init__
>> self.read(stream)
>> File "C:\Program Files (x86)\IronPython
>> 2.7.1\lib\site-packages\pyPdf\pdf.py", line 732, in read
>> num = readObject(stream, self)
>> File "C:\Program Files (x86)\IronPython
>> 2.7.1\lib\site-packages\pyPdf\generic.py", line 87, in readObject
>> return NumberObject.readFromStream(stream)
>> File "C:\Program Files (x86)\IronPython
>> 2.7.1\lib\site-packages\pyPdf\generic.py", line 236, in readFromStream
>> return NumberObject(name)
>> TypeError: expected int, got str
>> >>>
>>
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
>>
>>
>
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users
