classification
Title: PyUnicode_FromFormat broken and not documented for 2.x
Type: crash Stage: resolved
Components: Documentation, Interpreter Core, Unicode Versions: Python 2.7, Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A
View: 7330
Assigned To: lemburg Nosy List: BreamoreBoy, belopolsky, ezio.melotti, georg.brandl, lemburg, ronaldoussoren, vstinner, ysj.ray
Priority: normal Keywords:

Created on 2009-12-24 11:54 by ronaldoussoren, last changed 2014-09-30 22:15 by vstinner. This issue is now closed.

Messages (5)
msg96853 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-12-24 11:54
Include/unicodeobject.h includes prototypes for PyUnicode_FromFormat and 
PyUnicode_FromFormatV in both 2.6 and 2.7, but those functions are not 
included in the documention.

And worse, the implementation contains bugs: the %R format code tries to 
include the repr() of an object and blindly assumes that the result of 
PyObject_Repr is a unicode string. In the 2.x tree PyObject_Repr usually 
(but not allways) returns a regular string (str instead of unicode).

The same problem is present in the implementation of %S.

For the %U and %V formats the code does typechecking in an assert 
statement rather than always testing and bailing out using a NULL result 
from the function.
msg112993 - (view) Author: ysj.ray (ysj.ray) Date: 2010-08-05 16:14
It seems there is pretty much problems in PyUnicode_FromFormatV().
see issue7330.
msg127685 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-02-01 05:30
Documentation part of this issue will be addressed in #10435.
msg228004 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-09-30 21:29
With Stage "resolved" and Resolution "duplicate" surely this can be closed?
msg228013 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-09-30 22:15
Ok, let's close the issue.
History
Date User Action Args
2014-09-30 22:15:25vstinnersetstatus: open -> closed
nosy: + vstinner
messages: + msg228013

2014-09-30 21:29:42BreamoreBoysetnosy: + BreamoreBoy
messages: + msg228004
2011-02-01 05:30:07belopolskysetnosy: + belopolsky
messages: + msg127685
resolution: duplicate

superseder: PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A
stage: needs patch -> resolved
2010-08-05 16:14:49ysj.raysetnosy: + ysj.ray
messages: + msg112993
2010-08-04 21:38:05BreamoreBoysetassignee: georg.brandl -> lemburg

nosy: + lemburg
2009-12-30 23:20:18alexandre.vassalottilinkissue7608 superseder
2009-12-25 02:28:22ezio.melottisetpriority: normal
nosy: + ezio.melotti
components: + Unicode
2009-12-24 11:54:39ronaldoussorencreate