A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-January/107563.html below:

[Python-Dev] [Python-checkins] r87815 - peps/trunk/pep-3333.txt

[Python-Dev] [Python-checkins] r87815 - peps/trunk/pep-3333.txt [Python-Dev] [Python-checkins] r87815 - peps/trunk/pep-3333.txtJames Y Knight foom at fuhm.net
Fri Jan 21 04:16:36 CET 2011
On Jan 20, 2011, at 9:31 PM, Ezio Melotti wrote:
>> Modified: peps/trunk/pep-3333.txt
>> ==============================================================================
>> --- peps/trunk/pep-3333.txt     (original)
>> +++ peps/trunk/pep-3333.txt     Fri Jan  7 16:39:27 2011
>> @@ -310,9 +310,9 @@
>>             elif not headers_sent:
>>                  # Before the first output, send the stored headers
>>                  status, response_headers = headers_sent[:] = headers_set
>> -                 sys.stdout.write('Status: %s\r\n' % status)
>> +                 sys.stdout.buffer.write('Status: %s\r\n' % status)
>>                  for header in response_headers:
>> -                     sys.stdout.write('%s: %s\r\n' % header)
>> +                     sys.stdout.buffer.write('%s: %s\r\n' % header)
> 
> Also note that .buffer might not be available in some cases (i.e. when sys.stdout has been replaced with other objects).

Do you have a recommendation for a better way to do bytes I/O on stdin/sydout, then?...just saying that .buffer might not be available isn't a very useful comment unless there's a replacement idiom... 

James
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4