~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/smart.py

  • Committer: Alexander Belchenko
  • Date: 2007-03-04 00:28:13 UTC
  • mto: This revision was merged to the branch mainline in revision 2317.
  • Revision ID: bialix@ukr.net-20070304002813-bfca6obrj3xcqy7y
SmartServerPipeStreamMedium: binary mode should be forced for media

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
from cStringIO import StringIO
198
198
import os
199
199
import socket
 
200
import sys
200
201
import tempfile
201
202
import threading
202
203
import urllib
544
545
        :param backing_transport: Transport for the directory served.
545
546
        """
546
547
        SmartServerStreamMedium.__init__(self, backing_transport)
 
548
        if sys.platform == 'win32':
 
549
            # force binary mode for files
 
550
            import msvcrt
 
551
            for f in (in_file, out_file):
 
552
                fileno = getattr(f, 'fileno', None)
 
553
                if fileno:
 
554
                    msvcrt.setmode(fileno(), os.O_BINARY)
547
555
        self._in = in_file
548
556
        self._out = out_file
549
557