[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2015-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: Let's not do this. The time to meddle with Python 2.7 details is long gone. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20015

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2015-02-16 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- stage: patch review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20015 ___ ___

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2015-02-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is your decision Guido and Benjamin? -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20015 ___

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-05-22 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: -skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20015 ___ ___ Python-bugs-list

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch with tests. Not all affected methods are tested because not all methods and modules have tests at all. -- Added file: http://bugs.python.org/file34284/getargs_c_unicode_2.patch ___ Python tracker

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: This sounds reasonable to me, but the patch lacks tests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20015 ___

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: However, do note that the semantics will end up different from other uses of unicode. e.g.: aa.strip(ub) u'aa' In str.strip(), passing an unicode parameter returns an unicode string. In str.ljust(), passing an unicode parameter will return a byte string.

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: The behavior of str.strip is not what I would expect from reading '''str.strip([chars]) Return a copy of the string with the leading and trailing characters removed.''' but I guess it is consistent with a general rule that when mixing bytes and unicode

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: However, do note that the semantics will end up different from other uses of unicode. e.g.: aa.strip(ub) u'aa' And this behavior is weird. print 'À\n'.strip('\n') À print 'À\n'.strip(u'\n') Traceback (most recent call last): File stdin, line 1, in

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Re-opened due to Python-Dev discussion http://comments.gmane.org/gmane.comp.python.devel/146057. -- resolution: invalid - stage: committed/rejected - patch review status: closed - open ___ Python tracker

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2013-12-21 Thread Stefan Krah
Stefan Krah added the comment: Well, generally I'd be against adding features, but this particular one could be rationalized in the same way as PEP 414. So I'm simply unsure whether the feature should be added, but *if* it's added, it should be backed by a pronouncement either from the RM or

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2013-12-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: PEP414 was about adding a feature to 3.3 well before the first alpha release. What Guido has recently said about 2.7 is that after 3 1/2 years we should concentrate on build issues such as came up with the new OSX and de-emphasize or even cease fixing bugs.

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2013-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Victor and Stefan are correct. 2.7 is a fixed version of Python. CPython 2.7.z, z = 1, only gets bug (and build) fixes. A 'new 2.7 version' would be 2.8, which will not happen. The fact that you propose to change the unambiguous doc shows that this is an

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2013-12-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: In most cases when str object required, unicode object is allowed too. s and z codes (with modifiers) in PyArg_Parse*() accept both str and unicode instances. But c code accepts only 1-character str, not unicode. This makes harder writing version-agnostic

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2013-12-18 Thread STINNER Victor
STINNER Victor added the comment: I don't like the heuristic of ASCII only characters. Accepting that may lead to bugs if later you pass a non-ASCII character. And is it not too late to change that in Python 2.7? Version released 3 years ago and widely used in production. -- nosy:

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2013-12-18 Thread Stefan Krah
Stefan Krah added the comment: I guess it makes porting to Python 3 easier, but can we do this in a stable release? -- nosy: +benjamin.peterson, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20015

[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2013-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't like the heuristic of ASCII only characters. Accepting that may lead to bugs if later you pass a non-ASCII character. What behavior you propose for non-ASCII values? And is it not too late to change that in Python 2.7? Version released 3 years