Re: When file-like objects aren't file-like enough for Windows

2008-03-16 Thread Tim Golden
William McBrine wrote: > Now, I have a similar problem with subprocess.Popen... The code that > works in Linux looks like this: > > source = urllib.urlopen(url) > child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=source) > try: > shutil.copyfileobj(child.stdout, self

When file-like objects aren't file-like enough for Windows

2008-03-16 Thread William McBrine
This is proving to be a recurring problem for me. First, I used the save() method of a Python Imaging Library "Image" object to write directly to the "wfile" of a BaseHTTPRequestHandler- derived class: pic.save(self.wfile, 'JPEG') Worked great in Linux, barfed in Windows. I had to do this