Export to GitHub

subprocdev - issue #6

universal_newlines attribute of Popen() broken


Posted on Jul 13, 2010 by Swift Ox

Using subprocess.py on Windows XP, Python 3.1.

Exception happened during processing of request from ('127.0.0.1', 1598) Traceback (most recent call last): File "C:\Python31\lib\socketserver.py", line 281, in _handle_request_noblock error: `hello' undefined near line 1 column 1 self.process_request(request, client_address) File "C:\Python31\lib\socketserver.py", line 307, in process_request self.finish_request(request, client_address) File "C:\Python31\lib\socketserver.py", line 320, in finish_request self.RequestHandlerClass(request, client_address, self) File "C:\Python31\lib\socketserver.py", line 614, in init self.handle() File "C:\Python31\lib\http\server.py", line 352, in handle self.handle_one_request() File "C:\Python31\lib\http\server.py", line 346, in handle_one_request method() File "G:\Code\Python\OctaveServer\OctaveServer.py", line 25, in do_POST output = octave.recv() File "G:\Code\Python\OctaveServer\subprocess.py", line 835, in recv return self._recv('stdout', maxsize) File "G:\Code\Python\OctaveServer\subprocess.py", line 960, in _recv read = self._translate_newlines(read) TypeError: _translate_newlines() takes exactly 3 positional arguments (2 given)

Checked out the code, at lines 960 and 1002 the encoding parameter is missing, while the definition at line 814 doesn't set a default value for the encoding. For now I added the 'self.stdout.encoding' values to lines 960 and 1002 since you can't set the function's default as that.

Status: New

Labels:
Type-Defect Priority-Medium