Message251853
| Author |
r.david.murray |
| Recipients |
r.david.murray |
| Date |
2015年09月29日.12:48:03 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1443530883.35.0.305082154526.issue25269@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Because surrogates are in several contexts used to "smuggle" bytes through string APIs using surrogateescape, it is very useful to be able to determine if a given string contains surrogates. The email package, for example, uses different logic to handle strings that contain smuggled bytes and strings that don't when serializing a Message object. Currently it uses x.encode() and checks for an exception (we determined that for CPython this was the most efficient method to check). It would be better, I think, to have a dedicated method on str for this, among other reasons so that different python implementations could optimize it appropriately.
(Note that another aspect of dealing with surrogateescaped strings is discussed in issue 18814.) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年09月29日 12:48:03 | r.david.murray | set | recipients:
+ r.david.murray |
| 2015年09月29日 12:48:03 | r.david.murray | set | messageid: <1443530883.35.0.305082154526.issue25269@psf.upfronthosting.co.za> |
| 2015年09月29日 12:48:03 | r.david.murray | link | issue25269 messages |
| 2015年09月29日 12:48:03 | r.david.murray | create |
|