Message3929

Author kam
Recipients kam
Date 2008-12-15.19:59:15
SpamBayes Score 3.324456e-09
Marked as misclassified No
Message-id <1229371155.79.0.9930873406.issue1204@psf.upfronthosting.co.za>
In-reply-to
Content
It is no longer possible to create a file object from a Java
InputStream. This last worked for me in 2.5a1.

Simple test:

from __future__ import with_statement

from java.io import FileInputStream as FIS
from org.python.core import PyFile

with open("in.txt","w") as f:
    f.write("spam!\n")

# Neither constructor works
PyFile(FIS("in.txt"))
file(FIS("in.txt"))

Fails with:

Traceback (most recent call last):
  File "filestream.py", line 10, in <module>
    PyFile(FIS("in.txt"))
TypeError: coercing to Unicode: need string, 'javainstance' type found
History
Date User Action Args
2008-12-15 19:59:15kamsetrecipients: + kam
2008-12-15 19:59:15kamsetmessageid: <1229371155.79.0.9930873406.issue1204@psf.upfronthosting.co.za>
2008-12-15 19:59:15kamlinkissue1204 messages
2008-12-15 19:59:15kamcreate