[issue32195] datetime.strftime with %Y no longer outputs leading zeros

2017-12-01 Thread Dave Challis
Dave Challis <sui...@gmail.com> added the comment: My mistake, it appears to be related to the OS it's running on rather than the version (I just happened to test with different versions on different OSes). On Mac OS X (with 3.6.2): >>>

[issue32195] datetime.strftime with %Y no longer outputs leading zeros

2017-12-01 Thread Dave Challis
New submission from Dave Challis <sui...@gmail.com>: Tested in python 3.6.2: >>> import datetime >>> datetime.datetime.min.strftime('%Y') '1' Expected output: '0001' This means that strftime and strptime aren't necessarily symmetric, e.g.: >&g

[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Dave Challis
New submission from Dave Challis: This occurred when attempting to decode invalid UTF-8 bytes using errors='replace', then attempting to lowercase the produced unicode string. This was also tested in python 2.7, but it doesn't occur there. Code to reproduce: x = b'\xe2\xb3\x99\xb3\xd1\x9f

[issue18155] csv.Sniffer.has_header doesn't escape characters used in regex

2013-06-07 Thread Dave Challis
New submission from Dave Challis: When attempting to detect the presence of CSV headers, delimiters are passed to a regex function without escaping, which causes an exception if a delimiter which has meaning in a regex (e.g. '+', '*' etc.) is used. Code to reproduce: import csv s