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.

Author vstinner
Recipients ezio.melotti, flox, georg.brandl, loewis, mark.dickinson, pepalogik, vstinner
Date 2013-02-07.14:38:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1360247899.35.0.122514964661.issue17137@psf.upfronthosting.co.za>
In-reply-to
Content
Can you try to following command to get the size in bytes of the wchar_t type?

>>> import types
>>> ctypes.sizeof(ctypes.c_wchar)
4

You can also use _PyObject_Dump() to dump your string:

>>> import ctypes
>>> x="abc"
>>> _PyObject_Dump=ctypes.pythonapi._PyObject_Dump
>>> _PyObject_Dump.argtypes=(ctypes.py_object,)
>>> _PyObject_Dump(x)
object  : 'abc'
type    : str
refcount: 5
address : 0xb70bf980
48

Then you can use _PyObject_Dump() on your string.

You may also try: print(list(dirname)).

It's really strange that something very common like string concatenation returns an invalid string.
History
Date User Action Args
2013-02-07 14:38:19vstinnersetrecipients: + vstinner, loewis, georg.brandl, mark.dickinson, ezio.melotti, flox, pepalogik
2013-02-07 14:38:19vstinnersetmessageid: <1360247899.35.0.122514964661.issue17137@psf.upfronthosting.co.za>
2013-02-07 14:38:19vstinnerlinkissue17137 messages
2013-02-07 14:38:19vstinnercreate