This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年04月23日 13:18 by ddvoinikov, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| format_nonascii.patch | vstinner, 2012年04月23日 21:16 | review | ||
| Messages (10) | |||
|---|---|---|---|
| msg159014 - (view) | Author: Dmitry Dvoinikov (ddvoinikov) | Date: 2012年04月23日 13:18 | |
Using Python 3.3.0a2 (default, Apr 1 2012, 19:34:58) [MSC v.1500 64 bit (AMD64)] on win32.
This line of code
"{0:s}{1:s}".format("ABC", "\u0410\u0411\u0412")
results in
SystemError: Cannot copy UCS2 characters into a string of ascii characters
|
|||
| msg159015 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年04月23日 13:45 | |
I get this result on a debug build of default on linux:
>>> "{0:s}{1:s}".format("ABC", "\u0410\u0411\u0412")
python: Objects/unicodeobject.c:1223: _copy_characters: Assertion `ch <= to_maxchar' failed.
|
|||
| msg159023 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年04月23日 14:55 | |
New changeset c7163a7f7cd2 by Benjamin Peterson in branch 'default': inherit maxchar of field value where needed (closes #14648) http://hg.python.org/cpython/rev/c7163a7f7cd2 |
|||
| msg159024 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年04月23日 14:59 | |
A test needs to be added for this. |
|||
| msg159025 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年04月23日 15:04 | |
What makes you think there isn't one? |
|||
| msg159026 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年04月23日 15:22 | |
> New changeset c7163a7f7cd2 by Benjamin Peterson in branch 'default': > inherit maxchar of field value where needed (closes #14648) > http://hg.python.org/cpython/rev/c7163a7f7cd2 The patch is wrong if the format only gets a substring instead of the full string. I have a pending patch for this. |
|||
| msg159027 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年04月23日 15:23 | |
Ah, you are right. |
|||
| msg159033 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年04月23日 15:47 | |
> What makes you think there isn't one? Poor eyesight? Sorry. |
|||
| msg159083 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年04月23日 21:16 | |
>>>> "{0:s}{1:s}".format("ABC", "\u0410\u0411\u0412")
> python: Objects/unicodeobject.c:1223: _copy_characters: Assertion `ch <= to_maxchar' failed.
Attached patch fixes this issue.
|
|||
| msg159087 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年04月23日 21:43 | |
New changeset 139c3ae84772 by Victor Stinner in branch 'default': Close #14648: Compute correctly maxchar in str.format() for substrin http://hg.python.org/cpython/rev/139c3ae84772 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:29 | admin | set | github: 58853 |
| 2012年04月23日 21:43:12 | python-dev | set | status: open -> closed resolution: fixed messages: + msg159087 stage: test needed -> resolved |
| 2012年04月23日 21:16:07 | vstinner | set | files:
+ format_nonascii.patch keywords: + patch messages: + msg159083 |
| 2012年04月23日 15:47:14 | r.david.murray | set | messages: + msg159033 |
| 2012年04月23日 15:40:57 | benjamin.peterson | set | status: closed -> open resolution: fixed -> (no value) |
| 2012年04月23日 15:23:19 | benjamin.peterson | set | messages: + msg159027 |
| 2012年04月23日 15:22:19 | vstinner | set | messages: + msg159026 |
| 2012年04月23日 15:04:09 | benjamin.peterson | set | status: open -> closed nosy: + benjamin.peterson messages: + msg159025 |
| 2012年04月23日 14:59:55 | r.david.murray | set | status: closed -> open priority: release blocker -> normal messages: + msg159024 keywords: + easy stage: resolved -> test needed |
| 2012年04月23日 14:55:36 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg159023 resolution: fixed stage: needs patch -> resolved |
| 2012年04月23日 13:45:08 | r.david.murray | set | priority: normal -> release blocker nosy: + loewis, vstinner, r.david.murray messages: + msg159015 type: behavior -> crash stage: needs patch |
| 2012年04月23日 13:18:06 | ddvoinikov | create | |