antocuni changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | "PyPy: the Gradual Reduction of Magic (tm)"
lritter has joined #pypy
jacob22__ has quit [Ping timeout: 248 seconds]
tbodt has quit [Read error: Connection reset by peer]
tbodt has joined #pypy
marr has quit [Ping timeout: 260 seconds]
jamadden has quit [Ping timeout: 276 seconds]
oberstet has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jcea has quit [Quit: jcea]
tbodt has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lritter_ has joined #pypy
lritter has quit [Ping timeout: 255 seconds]
oberstet2 has joined #pypy
oberstet has quit [Ping timeout: 240 seconds]
oberstet2 has quit [Ping timeout: 248 seconds]
oberstet has joined #pypy
oberstet2 has joined #pypy
oberstet has quit [Ping timeout: 240 seconds]
jamesaxl has quit [Quit: WeeChat 2.0.1]
oberstet2 has quit [Ping timeout: 276 seconds]
dddddd has quit [Remote host closed the connection]
tbodt has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
raynold has joined #pypy
energizer has quit [Quit: Leaving]
energizer has joined #pypy
energizer has quit [Client Quit]
energizer has joined #pypy
dustinm has quit [Ping timeout: 268 seconds]
dustinm has joined #pypy
<nanonyme> mattip, fresh install of VS2017 with no prior VS2015 on machine, try to compile CFFI for Python3.5 fails unless vcvarsall.bat is manually run
<nanonyme> mattip, if you meant that. No big deal imo
<Rotonen> nanonyme: you're not supposed to compile with vs2017, though
jamesaxl has joined #pypy
dan- has joined #pypy
dan- has joined #pypy
dan- has quit [Changing host]
<arigato> mattip: I also keep getting the same vcvarsall.bat error message with cpython 2.7, I eventually fixed it by defining VS90COMNTOOLS
<arigato> after looking through the source code
inhahe has quit []
inhahe has joined #pypy
<mattip> arigato, nanonyme: there is "import setuptools" before "import distutils" ?
<mattip> in the setup.py
<mattip> it seems cffi/setup.py calls uses_msvc() ->get_config() -> "import distutils" before "import setuptools"
<nanonyme> mattip, sounds like setuptools doesn't do it right either then
<nanonyme> Rotonen, why not? It works fine
<nanonyme> arigato, any chance of getting the second fix and release done soonish? I can probably backport to ours as necessary
<arigato> mattip: ah, it's an issue of import order *in addition to* being an issue of monkey-patching? the setuptools/distutils is a complete hack
<nanonyme> arigato, root cause why your fix doesn't work is there's two FFI().dlopen's, one is in Python-side, one is in C-side (latter is for out-of-order ABI which I use)
<nanonyme> Both need the unicode treatment
<mattip> arigato: in the case I pointed out there is no import of setuptools before compiling
<nanonyme> The C-cide dlopen doesn't call load_module at all
<nanonyme> Erm, load_library or whatever it was that you fixed
<nanonyme> Right, so probably setuptools just doesn't support VS2017 properly yet
<arigato> nanonyme: yes, coming
<kenaan_> arigo cffi/cffi b576c88f25f7 /setup.py: In the setup.py, always import setuptools first on Windows
<kenaan_> arigo cffi/cffi cdaebfeea0f0 /: Implement ffi.dlclose() for the in-line case
<arigato> (not these checkins, the next one)
<mattip> arigato: does setup.py now work without the env variable?
<arigato> mattip: yes, seems so
<mattip> cool
<nanonyme> <3
<mattip> I think the actual use of cffi.verify,() cffi.compile() in the setup.py in the snippets is OK, since there we already have a hack
<mattip> but I can check later when I finish fixing cpyext/datetime since writing a test exposed a problem
<arigato> no cluuuuuue it seems that the same code in cdlopen.c actually works for me
<arigato> I mean without any change
<arigato> it doesn't make any sense
<arigato> ok found it: using "tm" works, but using "ξ" doesn't, on my machine
<arigato> ok now "hg diff" doesn't find my modified file. again, no cluuuuuuuue
<nanonyme> arigato, yeah, these things are really painful to debug. Which codepage do you use?
<nanonyme> (and test. and verify)
<kenaan_> arigo cffi/cffi d7d2eae6f698 /c/_cffi_backend.c: Revert these small changes
<nanonyme> What I do know I put your code into cdlopen.c yesterday, compiled and it fixed my issues
<arigato> yes, I guess so
<arigato> turns out I don't have any problems with "tm", but I do with "ξ"
<nanonyme> Maybe we should be using both of those in path to maximize breakage \o/
<nanonyme> I'm assuming the thing here is they're for some reason representable with MBCS for one of us always so it doesn't break
marr has joined #pypy
realitix has joined #pypy
oberstet has joined #pypy
<nanonyme> arigato, IOW you might have noticed sys.getfilesystemencoding() == "mbcs" until 3.6 on Windows. This is a crazy hack that tries to encode things to be usable through ANSI API's and sometimes works \o/
<arigato> head <-> wall interaction
<nanonyme> It gets to some extent worse with 3.6 since then sys.getfilesystemencoding() is "utf-8" so it will 1) never fail to encode 2) never work properly with ANSI API's
<nanonyme> As in, the UTF-8 string is *valid* through ANSI API, it just will not point to any existing file
<nanonyme> I suspect it might fail more consistently over different codepages then though
<kenaan_> arigo cffi/cffi 5448f4eca09c /: More Windows support for ffi.dlopen(), this time the out-of-line version
<arigato> "maybe"
energizer has quit [Ping timeout: 256 seconds]
energizer has joined #pypy
jacob22__ has joined #pypy
<nanonyme> I know :(
<nanonyme> Also I just realized while on lunch that while it might fail more consistently, it will display total bonkers since you'll see the correct path since your console is UTF-8 and filesystem encoding is UTF-8 but this is not at all how Windows interpreted it when you passed it to the ANSI API
<nanonyme> So IOW 3.6 will blatantly lie to you that the filename is ok
<nanonyme> (visually)
energizer has quit [Ping timeout: 256 seconds]
lritter_ has quit [Quit: Leaving]
Taggnostr has quit [Remote host closed the connection]
Taggnostr has joined #pypy
ronan has quit [Ping timeout: 260 seconds]
<nanonyme> Anyhow, time to test your changes again, I guess
<nanonyme> arigato, sorry for causing all this hassle
ronan has joined #pypy
jamadden has joined #pypy
jamadden has quit [Quit: Leaving.]
jamadden has joined #pypy
mattip has left #pypy ["bye"]
raynold has quit [Quit: Connection closed for inactivity]
jacob22__ has quit [Ping timeout: 256 seconds]
dddddd has joined #pypy
forgottenone has joined #pypy
Rhy0lite has joined #pypy
realitix_ has joined #pypy
jacob22__ has joined #pypy
realitix has quit [Ping timeout: 256 seconds]
realitix_ is now known as realitix
realitix has quit [Client Quit]
realitix has joined #pypy
realitix has quit [Quit: realitix]
realitix has joined #pypy
adamholmberg has joined #pypy
jcea has joined #pypy
mattip has joined #pypy
ebarrett has joined #pypy
<mattip> cpython3 has two datetime modules, one is pure python in lib-python/3/datetime.py
<mattip> and then they repeat the whole thing in C in _datetime.c
<mattip> maybe I should stop fighting the inconsistencies btwn the two for cpyext and simply use them both datetime.py and _datetime.c as is
<mattip> current problem - datetime inherits from date, but datetime has a tzinfo field in the C-API struct and date does not
inad922 has joined #pypy
tos9_ has joined #pypy
tos9 has quit [Ping timeout: 264 seconds]
tos9_ is now known as tos9
mattip has left #pypy ["bye"]
jcea has quit [Ping timeout: 255 seconds]
jcea has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholm_ has joined #pypy
jacob22__ has quit [Ping timeout: 264 seconds]
adamholmberg has quit [Ping timeout: 265 seconds]
jcea1 has joined #pypy
jcea has quit [Read error: Connection reset by peer]
jcea1 is now known as jcea
jcea has quit [Read error: Connection reset by peer]
jcea has joined #pypy
realitix has quit [Ping timeout: 256 seconds]
jcea has quit [Quit: jcea]
inad922 has quit [Ping timeout: 248 seconds]
cjwelborn has quit [Remote host closed the connection]
jcea has joined #pypy
marr has quit [Ping timeout: 256 seconds]
realitix has joined #pypy
realitix has quit [Remote host closed the connection]
marky1991 has joined #pypy
jamadden has quit [Ping timeout: 252 seconds]
jamadden has joined #pypy
raynold has joined #pypy
dw has quit [Remote host closed the connection]
dw has joined #pypy
<nanonyme> Hm, can pip install from Bitbucket?
<tos9> pip knows about VCSes, not really specific sites
<tos9> so yeah -- either via bitbucket's git support or hg too
cjwelborn has joined #pypy
jamadden has quit [Ping timeout: 240 seconds]
jcea has quit [Quit: jcea]
inad922 has joined #pypy
oberstet has quit [Ping timeout: 248 seconds]
inad922 has quit [Ping timeout: 248 seconds]
<nanonyme> Meh, I just got the CFFI repo cloned, that should be enough
<nanonyme> So, right, now to verify the fix
<nanonyme> arigato, right, verified your latest fixes help here too
<nanonyme> arigato, to be honest, I'm not 100% sure if it even makes sense to fallback to ANSI-style LoadLibrary rather than to try to decode with filesystem encoding and then call wide version. That might or might not be backwards-incompatible though. Anyhow, current thing works for me nicely now :)
oberstet has joined #pypy
<nanonyme> Would be happy to see a release soon
energizer has joined #pypy
tbodt has joined #pypy
tbodt has quit [Client Quit]
marky1991 has quit [Ping timeout: 268 seconds]
marky1991 has joined #pypy
jcea has joined #pypy
hams has joined #pypy
<hams> looking for some advice on CFFI... i have some code which i can hide most of the complexity but it will return some complex data structures which invovle several structs
<hams> is this a reasonable usage for CFFI and is there a best practice for using it?
marr has joined #pypy
marky1991 has quit [Remote host closed the connection]
energizer has quit [Disconnected by services]
energizer has joined #pypy
energizer has quit [Remote host closed the connection]
energizer has joined #pypy
Rhy0lite has quit [Quit: Leaving]
marky1991 has joined #pypy
<arigato> hams: yes, that's reasonable for CFFI
<hams> arigato: thanks. i'm giving it a try... surprised to find that search for libraries does not honor LD_LIBRARY_PATH until python3.6
<arigato> unsure what you mean
<arigato> (that's because you can use cffi in various ways, so I've no clue which one you are using. also, I'm pretty sure there is nothing python3.6-specific)
marky1991 has quit [Ping timeout: 256 seconds]
forgottenone has quit [Remote host closed the connection]
jcea has quit [Ping timeout: 260 seconds]
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
jamesaxl has quit [Quit: WeeChat 2.0.1]
jacob22__ has joined #pypy
<hams> does cffi allow C functions to return blocks of memory? v = ffi.new("int *"); lib.some_c_call(v); x = v[1] doesn't appear to work as it says only element 0 is addressable?
adamholm_ has quit [Remote host closed the connection]
adamholmberg has joined #pypy
SunDwarf is now known as world
world is now known as SunDwarf
tbodt has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
SunDwarf is now known as await
speeder39 has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
hams has quit [Quit: Page closed]
jacob22__ has quit [Ping timeout: 248 seconds]
tbodt has quit [Read error: Connection reset by peer]
tbodt has joined #pypy
tbodt has quit [Read error: Connection reset by peer]
tbodt has joined #pypy