[Patches] [ python-Patches-1613500 ] Write mode option for fileinput module.

SourceForge.net noreply at sourceforge.net
Fri Dec 15 14:10:22 CET 2006


Patches item #1613500, was opened at 2006-12-11 22:16
Message generated for change (Comment added) made by mkam
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1613500&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: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Anthony Roy (antroy)
Assigned to: Nobody/Anonymous (nobody)
Summary: Write mode option for fileinput module.

Initial Comment:
The current implementation of the fileinput module allows an optional 'mode' keyword argumant to the FileInput initializer and the input() convenience function.

The attached patch provides a similar write_mode keyword argument with which to specify the write mode when the 'inplace' option is used.

Included in the patch file are:

1) Changes to the fileinput module to accomodate the optional write mode option

2) Additions to the fileinput tex documentation.

3) A refactored test module, where the tests have been reorganised into TestCase subclasses, and new tests added for the new functionality.

----------------------------------------------------------------------

Comment By: Martin Kammerhofer (mkam)
Date: 2006-12-15 14:10

Message:
Logged In: YES 
user_id=1656067
Originator: NO

The restriction that you cannot use inplace and openhook together seems
somewhat
arbitrary to me. Have you considered lifting it? From looking at the
source it
seems not too hard to do. There are uses for e.g. inplace editing
compressed files.
This would fit nicely with your patch.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1613500&group_id=5470


More information about the Patches mailing list