[issue21258] Add __iter__ support for mock_open

2014-07-04 Thread Arve Knudsen
Changes by Arve Knudsen arve.knud...@gmail.com: -- nosy: +Arve.Knudsen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21258 ___ ___ Python-bugs

[issue21258] Add __iter__ support for mock_open

2014-07-04 Thread Arve Knudsen
Arve Knudsen added the comment: I noticed this issue too, thanks for fixing it! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21258

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Arve Knudsen
New submission from Arve Knudsen arve.knud...@gmail.com: httplib doesn't specify the HTTP header 'content-length' for POST requests without data. Conceptually this makes sense, considering the empty content. However, IIS (7.5) servers don't accept such requests and respond with a 411 status

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: I can look into patch and 3.x tonight I think. Should I provide a test with an eventual patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14721

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: Which HTTP methods should we auto-define content-length for? POST and PUT? I noticed that my first attempt at a patch would define content-length also for GET requests, which broke a unit test (test_ipv6host_header

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: Actually, when inspecting the HTTP requests sent by Chrome for the different methods (a great little Chrome app called Postman let me fire requests manually), I found that content-length would be set for most methods. I could confirm

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: Here's my initial proposal for a patch against httplib, based on the 2.7 branch of cpython repository. I've included a couple of tests, which check that when content is empty, content-length is set to 0 for certain methods (POST/PUT etc

[issue14721] httplib doesn't specify content-length header for POST requests without data

2012-05-04 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: Yes, I agree it doesn't make much sense for HEAD AFAICT, but Chrome does it. Maybe there's a reason? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14721

[issue11139] subprocess: Arguments to .bat scripts get interpreted by shell

2011-02-07 Thread Arve Knudsen
New submission from Arve Knudsen arve.knud...@gmail.com: As a regression from Python 2.6, when running .bat scripts on Windows with f.ex. subprocess.call under Python 2.7.1, arguments get interpreted by the shell. This bit me in the way that I could no longer pass arguments containing

[issue11139] subprocess: Arguments to .bat scripts get interpreted by shell

2011-02-07 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: Would you mind defining why the 2.7 behaviour is correct in this particular case? The list2cmdline behaviour discussed in issue 8972 has to do with shell commandlines; in this case, in my eyes any shell invocation (in order to run a .bat I

[issue11139] subprocess: Arguments to .bat scripts get interpreted by shell

2011-02-07 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: I wasn't saying that subprocess is interpreting the arguments, but that the shell is. Which was highly unexpected to me when outside of shell mode (i.e., shell == False). From some further testing, though, I see that the transformation from

[issue11139] subprocess: Arguments to .bat scripts get interpreted by shell

2011-02-07 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: The non-obvious thing with 8972 is what to do with an argument list when the 'shell' option is True, isn't it? I can't see how it overlaps with my case. My suggestion is a flag to enable argument protection in Popen, either just

[issue11139] subprocess: Arguments to .bat scripts get interpreted by shell

2011-02-07 Thread Arve Knudsen
Arve Knudsen arve.knud...@gmail.com added the comment: I'll keep it in mind. On Mon, Feb 7, 2011 at 8:00 PM, R. David Murray rep...@bugs.python.orgwrote: R. David Murray rdmur...@bitdance.com added the comment: Yes, having a cmd.exe 'quote' function, parallel to the shutil 'quote