[issue28318] Python unittest.mock.mock_calls stores references to arguments instead of their values

2016-10-03 Thread Guillaume Chorn
Guillaume Chorn added the comment: If it's true that our ability to accurately deep-copy mutable args makes fixing this behavior impossible, we should at the very least update the official unittest.mock documentation to warn users that testing for mock calls with mutable arguments

[issue28318] Python unittest.mock.mock_calls stores references to arguments instead of their values

2016-09-30 Thread Guillaume Chorn
New submission from Guillaume Chorn: In the unittest.mock library, when a Mock object stores the calls made on it in its `mock_calls` attribute, it appears to store references to the call arguments instead of the actual values of the call arguments. In cases where call args are mutable types

Problem using s.strip() to remove leading whitespace in .csv file

2012-02-29 Thread Guillaume Chorn
Hello All, I have a .csv file that I created by copying and pasting a list of all the players in the NBA with their respective teams and positions ( http://sports.yahoo.com/nba/players?type=lastnamefirst=1query=go=GO!). Unfortunately, when I do this I have no choice but to include a single

Re: Problem using s.strip() to remove leading whitespace in .csv file

2012-02-29 Thread Guillaume Chorn
Thanks, the suggestion print name.decode(utf-8).strip() worked like a charm. When I did the print repr(name) I got exactly what you predicted. I'm not yet sure what all of this means, but I'm going to read this http://docs.python.org/howto/unicode.html in the hopes of finding out. Anyway