[Patches] [ python-Patches-1214879 ] Support non-file source/dest in marshal
SourceForge.net
noreply at sourceforge.net
Sat Jun 4 19:20:16 CEST 2005
Patches item #1214879, was opened at 2005-06-04 12:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1214879&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: Support non-file source/dest in marshal
Initial Comment:
I own bug #780354. The problem is that socket.makefile() no
longer returns a true file. This breaks code that had assumed
it did. The marshal module is one such instance.
In the above bug's corresponce Martin stated:
Instead, I think the C modules that expect file objects need
to be fixed.
Later on Martin stated that he thought it would be fine to simply
document the limitation for the marshal module. I ignored that
and fixed it in the attached patch. It includes modified docs and
an updated test suite.
It's obviously somewhat slower than the current version when
reading/writing true files. That's to be expected. I wanted to
get it right first. I imagine something can be done to speed
things up in the common case (run PyFile_Check() and make
calls to stdio functions if it is a true file).
Even if this patch is rejected, the modified test_marshal.py
should probably be kept (with suitable deletions), as it refactors
the individual tests into helper functions, thus avoiding a lot
of code duplication and potential future cut-n-paste errors.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1214879&group_id=5470
More information about the Patches
mailing list