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
altendky has joined #pypy
dddddd has quit [Remote host closed the connection]
BPL has quit [Quit: Leaving]
[Arfreve1] has quit [Quit: leaving]
_whitelogger has joined #pypy
[Arfrever] has joined #pypy
[Arfrever] has quit [Quit: leaving]
[Arfrever] has joined #pypy
lritter has quit [Ping timeout: 240 seconds]
lritter has joined #pypy
Kronuz has quit [Ping timeout: 245 seconds]
Kronuz has joined #pypy
oberstet has joined #pypy
tsaka__ has quit [Quit: Konversation terminated!]
tsaka__ has joined #pypy
_whitelogger has joined #pypy
forgottenone has joined #pypy
kirma has joined #pypy
<mattip> cfbolz: json-decoder-maps is worthy of a blog post
<kenaan> mattip default 5fa60afb5e51 /pypy/doc/release-v7.2.0.rst: update release note to latest HEAD
<kenaan> mattip release-pypy2.7-v7.x ab23a6930447 /: merge default into release (without json-default-maps for now)
micisuta has quit [Ping timeout: 240 seconds]
micisuta has joined #pypy
<cfbolz> mattip: yeah
<cfbolz> I have a draft, but need to redo some things
tsaka__ has quit [Ping timeout: 240 seconds]
tsaka__ has joined #pypy
antocuni has joined #pypy
_whitelogger has joined #pypy
wleslie has quit [Quit: ~~~ Crash in JIT!]
<cfbolz> mattip: issue 3079 looks like a utf-8 bug
_whitelogger has joined #pypy
_whitelogger has joined #pypy
<mattip> with that locale, date(2019, 8, 17).strftime('%B').encode('utf8') is b'ao\xfbt'
<cfbolz> mattip: ok, but why does .lower crash?
<mattip> cuz that is wrong. On cpython it is b'ao\xc3\xbbt'
<cfbolz> oh
<mattip> down the rabbit hole ...
<ronan> mattip: we're just missing the equivalent of PyUnicode_DecodeLocale()
<mattip> "just"?
<mattip> in strftime?
<ronan> yes
<mattip> ok
<cfbolz> I think we have failing cypthon tests about that too
<mattip> indeed, cpython/timemodule.c has two extra calls we are missing
<mattip> format = PyUnicode_EncodeLocale(format_arg, "surrogateescape")
<ronan> the fix is simple, but it's a bit annoying to test
<mattip> and PyUnicode_DecodeLocaleAndSize after the call
ebarrett is now known as vext01
jcea has quit [Ping timeout: 264 seconds]
<mattip> ok, I have a pretty simple failing test
<kenaan> rlamy py3.6 7392d01b93d0 /: Handle locale in time.strftime(). Fixes #3079
<ronan> CPython already had a test for this, but a) it's skipped and b) it doesn't fail
<ronan> I fixed b) but not a)
<mattip> thanks
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: are you sure the way you modified interp_time.py is correct? This test still fails
<mattip> it gets back 'ao\xed\xb3\xbbt' from str_decode_locale_surrogateescape
<mattip> and not b'ao\xc3\xbbt', which in cpython3 is the end result
<mattip> of time.strftime('%B', (2019, 8, 17, 0, 0, 0, 0, 0, 0)).encode('utf8')
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?
forgottenone has joined #pypy
<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
<mattip> https://speed.pypy.org/timeline/#/?exe=6,5&base=2+2052&ben=sphinx&env=3&revs=50&equid=off&quarts=on&extr=on
<mattip> jit off is 3x slower than cpython
<mattip> and bm_mdp jit off is 8x slower?
<mattip> https://speed.pypy.org/timeline/#/?exe=6,5&base=2+2052&ben=bm_mdp&env=3&revs=50&equid=off&quarts=on&extr=on
* mattip zzz
<cfbolz> mattip: ugh :-(
circ-user-KIvj2 has joined #pypy
circ-user-KIvj2 has quit [Ping timeout: 245 seconds]
BPL has joined #pypy
CrazyPython has joined #pypy
speeder39_ has joined #pypy
CrazyPython has quit [Read error: Connection reset by peer]
CrazyPython has joined #pypy
tsaka__ has quit [Ping timeout: 268 seconds]
CrazyPython has quit [Read error: Connection reset by peer]
lritter has quit [Ping timeout: 265 seconds]
lritter has joined #pypy
circ-user-KIvj2 has joined #pypy
circ-user-KIvj2 has quit [Ping timeout: 245 seconds]
BPL has quit [Quit: Leaving]