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

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

From: Branko Čibej <brane_at_xbc.nu>
Date: 2006-04-19 19:33:40 CEST

Paul Burba wrote:
> rooneg@gmail.com wrote on 04/17/2006 02:46:20 PM:
>
>
>> On 4/14/06, Paul Burba <paulb@softlanding.com> wrote:
>>
>>> 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.
>>>
>> I'm hardly a python expert, but it doesn't seem likely to be a problem
>> as far as I can tell... I'd recommend trying on windows and unix and
>> seeing what happens.
>>
>
> Hi Garrett,
>
> I tested this patch via ra_local and ra_dav on Windows XP (Apache 2.0.54,
> Neon 0.24.7) with fsfs. Everything passes. I don't have a unix box to
> test on, but I can remedy that given some time. In the meantime if
> someone could apply this patch and run it on some flavor of *nix that
> would be quite helpful...though in my limited *nix understanding there is
> no concept of a binary vs. text file so *how* could it matter?
>
I must admit I'm very surprised that the tests pass on Windows, but
using binary mode should certainly have no effect no Unix. If there's a
Unix out there that distinguishes between text and binary, it was
probably written somewhere close to Seattle. :)

(And no, I don't consider Cygwin to be Unix.)

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Apr 20 09:25:44 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.