|
From: <bc...@wo...> - 2001-07-22 12:56:39
|
[Samuele]
>Hi. A silly question:
Not silly at all.
>if foopkg is a package imported from a jar should:
>...
># vaguely inspired by jar: urls
>foopkg.__path__ = [SyspathArchiveXXX('foo.jar!/foopkg')]
I have updated the patch to follow this behaviour:
foopkg.__path__ == [SyspathArchive('foo.jar!foopkg')]
The magic string -> SyspathArchive works on all paths of this form, but
it will cause the archive to be opened each such a string is found on
sys.path. Hardly a problem I think.
>PS: I write this before I forget about it:
>in general (I mean across the various jvms), if ins is a stream
>obtained from a ZipFile
>
>ins.read(buf,len,av) != av
>
>I have been already bitten a few times by that. Maybe that will improve
>in the future. We should check if the old class/source reading code takes care
>of that.
Oh, right.
I remeber an even worse bug in some JVM (JDK1.1) where reading just one
byte beyond the size of the zip entry caused a EOFException (instead of
returning -1). The bug depends on the input file so it is damn hard to
test against.
The patch fixes both situation by reading the whole zip entry in a byte
array before returning the stream to the caller.
regards,
finn
|