[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PROPOSAL] Using binary mode in Python open() calls

From: Paul Burba <paulb_at_softlanding.com>
Date: 2006-04-14 14:57:07 CEST

Hi All,

A long time back I hacked up the Python test scripts to test the
Subversion OS400/EBCDIC port. At first all I did was tweak the scripts
running on Windows to actually test a remote AS400 server. Later, once we
ported the client to pre-V5R4 OS400, I ported the scripts themselves.*

Unfortunately what I've done so far is, I admit, fairly ugly and isn't
suitable for trunk. It's also a lot of work to keep up with as the tests
change.

So I'm taking a new look at this and applying lessons learned in the hope
I can make some changes to the scripts that are relatively unobtrusive,
won't affect other platforms, and will make our lives testing the OS400
port easier.

The first category of "fixes" I'd like to present for consideration are
the truly "general" in nature, i.e. no OS400 dependent script code. And
the first of these relates to the built-in Python function open(). For
those of you who remember the CCSID mess with apr_file_open() the
situation is not all that different: files on the OS400 are tagged with
CCSIDs representing the file's encoding and reading/writing/creating test
to these files presents a host of problems when the file is not opened in
binary mode. All of these problems are easily avoided by using the 'b'
mode with open().

So my question is: If all open() calls in the test scripts were done in
binary mode would this have any adverse effect on other platforms?

I've already tried this on XP and the tests run normally. I've looked at
the scripts and don't see any potential problems (yet). If any Python
experts would like to weigh in on this I'd appreciate it.

Thanks,

Paul B.

* A huge thank you to Per Gummedal, who ported Python to the AS400 -
http://www.iseriespython.com/

P.S. Don't know what the OS400/EBCDIC port is about? See:
http://svn.haxx.se/dev/archive-2006-02/0519.shtml)

P.P.S. I attached the patch to trunk for this change in case anyone wants
to try it out.

_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. and SoftLanding Europe Plc by IBM Email Security Management Services powered by MessageLabs.
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Fri Apr 14 14:57:49 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.