Author jj
Recipients ezio.melotti, jj, vstinner
Date 2014-07-30.17:10:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The documentation and the code example at

#include <Python.h>

main(int argc, char *argv[])
  Py_SetProgramName(argv[0]);  /* optional but recommended */
  PyRun_SimpleString("from time import time,ctime\n"
                     "print('Today is', ctime(time()))\n");
  return 0;

contradicts the actual implementation of the code:

which leads to compiler errors. To fix them, ugly wchar_t to char conversions are needed.

Also, I was hoping, Python 3.3 finally switched from wchar_t to char and UTF-8.
at least that's how I understood PEP 393

see also:

=> Are the docs wrong (which i hope are not, the example is straightforward and simple-stupid with a char*),
or is cpython wrong?
Date User Action Args
2014-07-30 17:10:42jjsetrecipients: + jj, vstinner, ezio.melotti
2014-07-30 17:10:42jjsetmessageid: <>
2014-07-30 17:10:42jjlinkissue22108 messages
2014-07-30 17:10:42jjcreate