Message124409
| Author |
ron_adam |
| Recipients |
belopolsky, doerwalter, eric.araujo, ezio.melotti, georg.brandl, gpolo, lambacck, rhettinger, ron_adam, vstinner |
| Date |
2010年12月20日.22:13:20 |
| SpamBayes Score |
2.0180783e-05 |
| Marked as misclassified |
No |
| Message-id |
<1292883205.48.0.574760510781.issue10087@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The problem is in the following line...
return ''.join(v).encode(encoding, "xmlcharrefreplace")
The .encode(encoding, "xmlcharrefreplace") is returning a bytes object.
Here is the simplest change to resolve the problem.
return str(''.join(v).encode(encoding, "xmlcharrefreplace"),
encoding=encoding)
But maybe a different way to implement "xmlcharrefreplace" is what is needed. Would it be better if it were a function or method in the xml (or html) module?
Just because it can be implemented as an encoding doesn't mean it should be. |
|