cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
<kenaan>
mattip py3.6 9d896e4b91a8 /lib_pypy/cffi/_pycparser/: merge default into py3.6
<kenaan>
mattip py3.6 e0c3eceb2db4 /pypy/interpreter/: back out b2dd9b388196 and reinstate abe60bf6dc7b
forgottenone has quit [Quit: Konversation terminated!]
<mattip>
AFICT, my python is using the HAVE_WCSFTIME variant. I wonder how it works on windows, where they avoid wcsftime
<mattip>
windows is OK
<ronan>
mattip: I think the issue is with str_decode_locale_surrogateescape()
jcea has joined #pypy
<mattip>
:(
jcea has quit [Remote host closed the connection]
<mattip>
comparing to cpython/Objects/unicodeobject.c, in unicode_decode_locale they actually have a surrogateescape path, we just ignore it
<ronan>
mattip: I think we implement only the surrogateescape path
forgottenone has joined #pypy
jcea has joined #pypy
<mattip>
ronan: I don't see a parallel to the call to encode_current_locale at the beginning of encode_locale which is called from _Py_EncodeLocaleEx which is called from unicode_decode_locale
forgottenone has quit [Quit: Konversation terminated!]
_whitelogger has joined #pypy
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
<ronan>
mattip: your test passes if you replace LC_TIME with LC_ALL (and remove the print)
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
jcea has quit [Quit: jcea]
<ronan>
mattip: the body of pypy_char2wchar is equivalent to decode_current_locale
CrazyPython has joined #pypy
dddddd has joined #pypy
CrazyPython has quit []
oberstet has quit [Remote host closed the connection]
<ronan>
so, after locale.setlocale(locale.LC_TIME, 'fr_FR'), LC_CTYPE gets set to fr_FR.UTF-8 on my system
<ronan>
which means that strftime returns stuff encoded in latin-1 but mbstowcs() decodes from UTF-8
<mattip>
agreed. I still don't see how it works correctly in CPython
<mattip>
on my system locale.getlocale(locale.LC_CTYPE) starts off with ('en_US', 'UTF-8'), and stays that way even after setting LC_TIME to 'fr_FR'
<ronan>
it works in time.strftime() because they use wcsftime()
<ronan>
but it doesn't work in general, e.g. after locale.setlocale(locale.LC_TIME, 'fr_FR'), locale.nl_langinfo(locale.MON_2) raises
<mattip>
interesting. On windows (which does not use wcsftime, I cannot set LC_TIME to fr_FR
<mattip>
I need to first set LC_CTYPE to 'fr_FR', then I can set LC_TIME
<mattip>
mess. Is there a PEP or something that documents all this?
<mattip>
from my reading of that PEP, it seems the only safe thing is to set a consistent LC_CTYPE, setting only LC_TIME is problematic (as we discovered)
xcm has quit [Killed (wolfe.freenode.net (Nickname regained by services))]
xcm has joined #pypy
jcea has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<mattip>
ronan: what do you think? Should we mimic CPython and use wcsftime on non windows platforms?
ilbelkyr has quit [Quit: updates]
ilbelkyr has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<ronan>
mattip: I'm not sure we care about supporting broken locale settings, beyond making sure it doesn't crash
<ronan>
and using strftime is likely to allow for more optimisation than with wcsftime, if we care
circ-user-KIvj2 has quit [Remote host closed the connection]
circ-user-KIvj2 has joined #pypy
circ-user-KIvj2 has quit [Ping timeout: 245 seconds]
ceridwen has quit [Remote host closed the connection]
CrazyPython has joined #pypy
CrazyPython has quit [Client Quit]
<mattip>
randomly looking at speed.pypy.org, the sphinx benchmark is horrible