arigato 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 | mac OS and Fedora are not Windows
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 250 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
dddddd has quit [Remote host closed the connection]
idnar has quit [Ping timeout: 252 seconds]
krono has quit [Ping timeout: 264 seconds]
starlord has quit [Ping timeout: 268 seconds]
stillinbeta has quit [Ping timeout: 252 seconds]
Guest62210 has joined #pypy
Guest62210 has quit [Ping timeout: 268 seconds]
idnar has joined #pypy
adamholmberg has joined #pypy
stillinbeta has joined #pypy
Guest62210 has joined #pypy
krono has joined #pypy
jcea has quit [Quit: jcea]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
PileOfDirt has quit [Quit: Leaving]
TwoPilesOfDirt has joined #pypy
TwoPilesOfDirt has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
[Arfrever] has joined #pypy
altendky has quit [Quit: Connection closed for inactivity]
altendky has joined #pypy
adamholmberg has joined #pypy
tos9 has quit [Ping timeout: 258 seconds]
tos9 has joined #pypy
adamholmberg has quit [Ping timeout: 252 seconds]
speeder39_ has quit [Quit: Connection closed for inactivity]
dddddd has joined #pypy
oberstet has joined #pypy
Ai9zO5AP has joined #pypy
altendky has quit [Quit: Connection closed for inactivity]
marky1991 has joined #pypy
Ai9zO5AP has quit [Ping timeout: 264 seconds]
xcm has quit [Read error: Connection reset by peer]
xcm has joined #pypy
Guest62210 has left #pypy [#pypy]
lauren has quit [Ping timeout: 252 seconds]
stillinbeta has quit [Ping timeout: 252 seconds]
stillinbeta has joined #pypy
ionelmc has quit [Ping timeout: 252 seconds]
Alex_Gaynor has quit [Ping timeout: 252 seconds]
avakdh has quit [Ping timeout: 252 seconds]
fijal has quit [Ping timeout: 252 seconds]
avakdh has joined #pypy
lauren has joined #pypy
Alex_Gaynor has joined #pypy
fijal has joined #pypy
ionelmc has joined #pypy
demonimin has quit [Quit: bye]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
marky1991 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
oberstet has quit [Quit: Leaving]
ClaudiaF has joined #pypy
darkman66 has joined #pypy
<ClaudiaF> Hello, if I have a question about cffi on windows x64 and cpython am I right here?
<auscompgeek> #python is probably a better place to ask questions about cffi on cpython, but I guess nobody's stopping you here
<ClaudiaF> Thank you, then I will give it a try at #python first :-)
ClaudiaF has quit [Quit: Leaving]
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
<cfbolz> auscompgeek: this is the right channel for cffi questions, actually
<auscompgeek> oh, huh
<cfbolz> cffi was written by PyPy people
<auscompgeek> cffi seemed a bit more disjoint from pypy these days though. oh well
darkman66 has quit [Remote host closed the connection]
ClaudiaF has joined #pypy
<cfbolz> auscompgeek: look at the channel topic ;-)
<cfbolz> ClaudiaF: hey :-)
<ClaudiaF> hi :-) already back :-D
<ClaudiaF> I'm preparing my question :-)
<tos9> anyone headed to PyCon US?
<ClaudiaF> I'm trying to define a structure using within embedding_api but I always get a compiler syntax error C2143. Here is what I do typedef struct {int id, weight, rfactor; } XPosition;
<ClaudiaF> That is the generate c part static void _cffi_checkfld_typedef_XPosition(XPosition *p)
<ClaudiaF> and error message syntax error: missing ')' before '*'
<ClaudiaF> Are there special settings I need to do on windows to make it work?
<ClaudiaF> Ok - don't know why I missed the part from the documentation about usage on windows, sorry for the noise.
alawrence has joined #pypy
ClaudiaF has left #pypy ["Leaving"]
<alawrence> I am having a problem using cffi. I need to pass a pointer to some data into a call back but this is being freed when the cffi pointer object goes out of scope. Is there anyway to transfer ownership of memory or somehow mark it as something to be persisted?
<fijal> alawrence: by storing the reference somewhere
<fijal> it's up to you to keep the reference
<alawrence> Is that the only way? I am currently copying some Python C module. They free memory inside a call back. I would have to do something different.
<arigato> you're talking about ffi.new_handle() right?
<alawrence> Nope. No I haven't used that.
<alawrence> I could be doing something very naive.
<arigato> ah, you simply want to allocate memory at one point, and free it at another point, both in Python?
<alawrence> Yes
<alawrence> I have a python function that calls a C function with some data and a call back.
<arigato> you need to add "void *malloc(size_t size);" and "void free(void *ptr);" to the cdef, and call that explicitly
<arigato> if you want to pass C-level memory, that is
<arigato> if you want to pass a reference to some Python objects, that's different
<alawrence> No it is some C memory. I think what you have suggested will work.
<arigato> OK
<arigato> note that then calling lib.malloc(42) just gives you a plain "void *" pointer
<arigato> you can optionally look at ffi.new_allocator() if you would prefer to use a syntax more similar to ffi.new()
<arigato> it's a way to wrap a low-level function like lib.malloc
<arigato> antocuni (for the logs): the ''.join() error is because of unicodeobject.py:578 and 580
<arigato> this passes to space.newutf8() the length, but counted in bytes, which is wrong
<alawrence> arigato: I tried doing dlopen(None) got the error "OSError: dlopen(None) cannot work on Windows for Python 3"
<arigato> yes, sorry, it cannot work on Windows for Python 3
<alawrence> No problem. Thanks for the advice anyway.
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
altendky has joined #pypy
darkman66 has joined #pypy
darkman66 has quit [Ping timeout: 250 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
darkman66 has joined #pypy
<kenaan> arigo default 1f16a5e43952 /pypy/: Fix the general testing for newstr(utf8, length_in_number_of_chars), which *now* should work and complain if we giv...
Kipras_ has joined #pypy
<alawrence> arigato: I ended up doing something similar with HeapAlloc. This works.
<arigato> cool
darkman66 has quit [Remote host closed the connection]
<kenaan> andrewjlawrence winoverlapped 80e8863b95ef /lib_pypy/: Fixed Subprocess tests
<bbot2_> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/4543 [Andy Lawrence: force build, winoverlapped]
darkman66 has joined #pypy
* arigato finds more bugs along the lines of issue #2997
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
forgottenone has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
Ai9zO5AP has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Ping timeout: 252 seconds]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
rtw_ has joined #pypy
rtw_ has quit [Quit: Mutter: www.mutterirc.com]
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
Kipras_ has quit [Read error: Connection reset by peer]
darkman66 has quit [Ping timeout: 240 seconds]
<alawrence> Does anyone have any other small/medium projects to work on once I have finished with this _winapi stuff?
<kenaan> arigo py3.6 c9339f40372b /pypy/objspace/std/unicodeobject.py: Translation fix
forgottenone has quit [Quit: Konversation terminated!]
<arigato> there are some more windows failures...
<alawrence> Yes there are lots of them.
<arigato> some of the failures listed in http://buildbot.pypy.org/summary?branch=py3.6 also appear on linux
<arigato> I'm unsure about the state of the "multiprocessing" module on windows
<arigato> it might be still missing a large windows-specific piece to work, unless someone else is already working on it
<alawrence> Where do the tests for that live?
<arigato> unsure
<arigato> it seems to be in lib-python/3/test/test_multiprocessing_*.py
<arigato> but they are not reported, maybe because they detect there is no multiprocessing module and so don't run anything
<arigato> try to run explicitly "pypy3 test_multiprocessing_something.py"
<alawrence> You are right it is trying to import something and fails.
<arigato> I don't see anybody working on it, unless I'm missing it
<arigato> so this would certainly be welcome :-)
<mattip> arigato: thanks for diving in to fix issue 2997
kanaka has quit [*.net *.split]
Remi_M has quit [*.net *.split]
commandoline has quit [*.net *.split]
trfl has quit [*.net *.split]
realtime has quit [*.net *.split]
Curi0 has quit [*.net *.split]
niceplace has quit [*.net *.split]
<mattip> alawrence: is _winapi ready to merge?
<mattip> winoverlapped
<arigato> :-)
* mattip wonders how much more of utf8 is buggy
<arigato> this was really just one corner case. we're getting there I think
<alawrence> mattip:I want to look at the test results.
<mattip> ok
<mattip> pr 642, 643 extend the PyDateTime_CAPI struct, which is an API change, so should really increment to pypy version 8
<mattip> and not be part of a bug fix 7.1.1 release I guess
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
commandoline has joined #pypy
niceplace has joined #pypy
trfl has joined #pypy
Remi_M has joined #pypy
Curi0 has joined #pypy
kanaka has joined #pypy
realtime has joined #pypy
realtime is now known as Guest5231
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
dddddd has quit [Read error: Connection reset by peer]
darkman66 has joined #pypy
altendky has quit [Quit: Connection closed for inactivity]
darkman66 has quit [Ping timeout: 250 seconds]
<mattip> toad_poloest: thanks. Will work out the merge once 7.1.1 goes out in a few days.
<mattip> toad_poloest: any thoughts about the Fold APIs for py3.6 to fully complete the API?
ramonvg has joined #pypy
darkman66 has joined #pypy
PileOfDirt has joined #pypy
<mattip> in 2996, we crash with a class method defined as "def meth(*args, offset=None)" when calling Foo().meth()
<mattip> but "def meth(self, *args, offset=None)" passes.
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
<mattip> is there a missing case in interpreter.function to push the kwarg values into new_frame.locals_cells_stack_w ?
ramonvg has quit [Quit: Lost terminal]
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
altendky has joined #pypy
darkman66 has joined #pypy
<mattip> args.parse_into_scope gives different results for "def meth(*args, offset=42)" and "def meth(*args, offset=42)"
forgottenone has joined #pypy
<mattip> the first does not parse the 42 into the scope, it gives [None, W_Tuple(self), None, None]
<mattip> and the second gives [self, W_IntObject(42), W_TupleObject(), None, None]
darkman66 has quit [Ping timeout: 250 seconds]
<mattip> (where self is a W_ObjectObjectUserDictWeakrefable)
<mattip> the function signature is Signature([], 'offset', None, ['offset']) in the first case
<mattip> and Signature(['self'], 'offset', None, ['offset']) in the second
* mattip off
<mattip> so the problem is in interpreter.argument.parse_into_scope
<mattip> but I don't really understand the interface
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
forgottenone has joined #pypy
forgottenone has quit [Client Quit]
forgottenone has joined #pypy
<kenaan> rlamy optimizeopt-cleanup dab1526f28a6 /rpython/jit/metainterp/: Pull use_unrolling() call out of optimize_trace()
<toad_poloest> mattip: Yeah I was going to do the fold APIs when the other stuff got merged to avoid merge conflicts.
<toad_poloest> I think I may have reference leaks in the PRs I submitted, though.
<toad_poloest> There are also some more changes to the API for 3.7, if you want I can add those as well, or you can ping me when it's time to start getting 3.7 support ready.
<mattip> toad_poloest: we need to start a py3.7 branch for that
<kenaan> mattip issue2996 f91f6fa3ca10 /pypy/objspace/std/test/test_callmethod.py: add a failing test (issue 2996)
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
<RemoteFox> cfbolz: I've rewritten method stack to fixed size list as you suggested
darkman66 has quit [Remote host closed the connection]
dddddd has joined #pypy
Ai9zO5AP has quit [Quit: WeeChat 2.4]
darkman66 has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
moei has joined #pypy
darkman66 has quit [Remote host closed the connection]
darkman66 has joined #pypy
alawrence has quit [Ping timeout: 256 seconds]
<bbot2_> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/4543 [Andy Lawrence: force build, winoverlapped]
forgottenone has quit [Quit: Konversation terminated!]
darkman66 has quit [Remote host closed the connection]
Taggnostr has quit [Remote host closed the connection]
Taggnostr has joined #pypy
inhahe has quit [Read error: Connection reset by peer]
inhahe has joined #pypy
<kenaan> rlamy optimizeopt-cleanup f6577bae1fb3 /rpython/jit/metainterp/: LoopCompileData.optimize() is only called with unroll=True; simplify optimize() and optimize_trace()
<kenaan> rlamy optimizeopt-cleanup eebbb92a8dfb /rpython/jit/metainterp/test/test_ajit.py: remove broken test