New submission from Kevin A. Mitchell <kam@...>:
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
----------
components: Core
messages: 3929
nosy: kam
severity: major
status: open
title: Unable to create file object from Java InputStream
type: behaviour
versions: 2.5b0
_______________________________________
Jython tracker <report@...>
<http://bugs.jython.org/issue1204>
_______________________________________
|