/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Alexander Belchenko
  • Date: 2007-01-24 10:45:08 UTC
  • mfrom: (2236 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2242.
  • Revision ID: bialix@ukr.net-20070124104508-mwiux3wozhk8939k
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
            replace - put in a bogus character (typically '?')
215
215
            exact - do not encode sys.stdout
216
216
 
 
217
            NOTE: by default on Windows, sys.stdout is opened as a text
 
218
            stream, therefore LF line-endings are converted to CRLF.
 
219
            When a command uses encoding_type = 'exact', then
 
220
            sys.stdout is forced to be a binary stream, and line-endings
 
221
            will not mangled.
 
222
 
217
223
    """
218
224
    aliases = []
219
225
    takes_args = []
246
252
        # Originally I was using self.stdout, but that looks
247
253
        # *way* too much like sys.stdout
248
254
        if self.encoding_type == 'exact':
 
255
            # force sys.stdout to be binary stream on win32
 
256
            if sys.platform == 'win32':
 
257
                fileno = getattr(sys.stdout, 'fileno', None)
 
258
                if fileno:
 
259
                    import msvcrt
 
260
                    msvcrt.setmode(fileno(), os.O_BINARY)
249
261
            self.outf = sys.stdout
250
262
            return
251
263