[issue12291] file written using marshal in 3.2 can be read by 2.7, but not 3.2 or 3.3

Benjamin Peterson report at bugs.python.org
Sun Jun 19 03:02:49 CEST 2011


Benjamin Peterson <benjamin at python.org> added the comment:

2011/6/18 Vinay Sajip <report at bugs.python.org>:
>
> Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:
>
>> Benjamin Peterson <benjamin at python.org> added the  comment:
>> >  Vinay Sajip <vinay_sajip at yahoo.co.uk> added the  comment:
>> >
>> > Sorry I'm being dense, but which file object do you  mean?
>>
>> The python file  object.
>
> Do you mean special-case handling of the circumstance when the file-like object
> being marshalled from is actually a file? The existing code paths (from when
> marshal.load expected only to work with Python file objects) use FILE *, and
> these are used by other code to read magic numbers etc. I believe. Or perhaps
> I'm still misunderstanding what you're getting at.

When python uses dump() or load() with a file object, you can call
fileno() (and then fopen?) to use it like a C-file object.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12291>
_______________________________________


More information about the Python-bugs-list mailing list