tbodt has joined #pypy
amaury has quit [Ping timeout: 240 seconds]
nimaje has joined #pypy
marky1991 has joined #pypy
kipras is now known as kipras`away
tilgovi has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tilgovi has quit [Ping timeout: 258 seconds]
pilne has quit [Quit: Quitting!]
ArneBab_ has joined #pypy
ArneBab has quit [Ping timeout: 260 seconds]
lritter has joined #pypy
lritter_ has joined #pypy
lritter has quit [Read error: Connection reset by peer]
mattip has joined #pypy
altendky has joined #pypy
forgottenone has joined #pypy
<kenaan> mattip cpyext-obj-stealing 104e7d49fd08 /pypy/module/cpyext/test/: fix tests for PyList_SetItem reference stealing
<mattip> cpython has a Py_REF_DEBUG macro to check when refcount < 0, but it requires recompiling cpython
<mattip> using that might have saved me some time fixing these tests
<kenaan> mattip cpyext-obj-stealing 168652ad5d5c /: merge default into branch
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/4578 [matti: force build, cpyext-obj-stealing]
glyph has quit [Quit: End of line.]
glyph has joined #pypy
jacob22_ has quit [Quit: Konversation terminated!]
<njs> huh, that's odd. on pypy, you can realloc a bytearray that has a memoryview pointing at it?
<njs> is that expected? (I noticed because I'm trying to be careful to make sure that I explicitly call .release() on my memoryviews to avoid issues with pypy's gc, and now I'm confused because the test I wrote for this isn't failing after all...)
<mattip> njs: "which version of pypy", and "might be a bug"
<njs> mattip: this is pypy3 5.7.0
<njs> mattip: test case is just 'b = bytearray(10); m = memoryview(b); b += bytes(100)' -- on cpython this raises BufferError, on that pypy it succeeds
Garen_ has joined #pypy
<mattip> jsut a wild guess, from my refcheck branch on pandas, perhaps cpython uses refcount semantics
<mattip> to track other references to the bytearray, and if ob_refcnt > 1 it raises
<mattip> let's see if I can verify that
<njs> on cpython, I believe mutable buffer exporting objects like bytearray have a special number-of-buffer-exports count
<njs> it's not ob_refcnt, you can have two variables pointing to the same bytearray object and still mutate it
Garen has quit [Ping timeout: 252 seconds]
* mattip cloning cpython from github, which feels wrong somehow
<njs> huh, it looks like the memoryview is actually following the bytearray's internal buffer around when it gets reallocated, at least if I'm correctly interpreting this ._pypy_raw_address method I found
<mattip> AFAICT we are missing cpython _canresize() function from Objects/bytearrayobject.c, we don't bother to track-and-check anythin like ob_exports
<njs> clever
<bbot2> Success: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/4578 [matti: force build, cpyext-obj-stealing]
<njs> but... what about this code, which also fails in bytearray _canresize()?
<njs> b = bytearray(10); a = np.asarray(b); b += bytes(100)
<njs> (I mean, it fails on cpython)
<mattip> my cursory glance at pypy.objspace.std.bytearrayobject.py, like in descr_add,
<njs> of course np.ndarray doesn't have anything like the memoryview.release method, so once you start doing this thing you're kind of screwed in any case without a refcounting gc
<mattip> seems to me we don't bother checking anything, we just reallocate
<njs> but yeah, it sounds like that leaves you with an ndarray pointing into the middle of nowhere?
<mattip> can you check that in your original example, m and b have different buffers, or do they overlap?
<njs> what do you mean by "have different buffers"?
<mattip> i.e. if you assign to m, the values in b do not change
<mattip> (b after the appending operation)
<njs> ah, no, in pypy3 it seems to be very clever – when I change the length of b, then m._pypy_raw_address() changes, and writes to either b or m are still visible in the other
DragonSA has joined #pypy
DragonSA has joined #pypy
DragonSA has quit [Changing host]
<njs> I assume this is do with the mechanism
<njs> ugh
<njs> I assume this is related to the mechanism the gc uses to keep pointers correct when moving objects
<mattip> so I guess everything is OK and we should simply document that difference,
<mattip> unless there is an explicit place in python documentation where cpython behaviour is required
<njs> heh, and if I shrink the size of the bytearray to be smaller than the memoryview, the memoryview starts raising IndexError!
<mattip> the documentation https://docs.python.org/2/library/stdtypes.html#memoryview is very terse about modifying the underlying buffer
<njs> the docs do mention this: https://docs.python.org/3/library/stdtypes.html#memoryview.release
<njs> "Many objects take special actions when a view is held on them (for example, a bytearray would temporarily forbid resizing)"
<njs> but I dunno that anyone cares about this. I only care because I wanted to make sure it wasn't happening :-)
<mattip> ok, so 3.2+ seems to need that
<njs> I guess you may run into trouble with cpyext stuff eventually though
<mattip> cpyext uses a "clever" PyBuffer to expose the buffer as a c-pointer
<mattip> and you are correct, there are probably still issues with it
<njs> mattip: so what does that np.asarray line I pasted above do on pypy?
<mattip> it seems to be messed up
<mattip> b = bytearray(10); a = np.asarray(b); b += bytes(100); print a; print a[0]; print a
<mattip> prints two different values for contents of a
<njs> well, uh, you're welcome I guess :-)
<mattip> :)
<mattip> very strange
altendky has quit [Quit: Connection closed for inactivity]
amaury has joined #pypy
arigato has joined #pypy
amaury has quit [Ping timeout: 240 seconds]
Tiberium has joined #pypy
ielectric has joined #pypy
ielectric is now known as domenkozar
arigato has quit [Read error: Connection reset by peer]
amaury has joined #pypy
oberstet has joined #pypy
Taggnostr has joined #pypy
antocuni has joined #pypy
FASDFSF has joined #pypy
Taggnostr has quit [Ping timeout: 260 seconds]
asmeurer_ has quit [Quit: asmeurer_]
Taggnostr has joined #pypy
arigato has joined #pypy
ramonvg has joined #pypy
antocuni has quit [Ping timeout: 255 seconds]
_whitelogger has joined #pypy
forgottenone has quit [Ping timeout: 260 seconds]
arigato has quit [Read error: Connection reset by peer]
mattip has left #pypy ["bye"]
amaury has quit [Ping timeout: 240 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
kipras`away is now known as kipras
kipras is now known as kipras`away
antocuni has joined #pypy
forgottenone has joined #pypy
kipras`away is now known as kipras
amaury has joined #pypy
jacob22_ has joined #pypy
Rhy0lite has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
amaury has quit [Ping timeout: 260 seconds]
rmesta has joined #pypy
rmesta1 has joined #pypy
antocuni has quit [Ping timeout: 255 seconds]
rmesta has quit [Ping timeout: 240 seconds]
<kenaan> arigo default fa2b7ecca667 /lib_pypy/_ctypes/structure.py: Issue #1213: in ctypes, complain instead of silently ignoring _swappedbytes_
oberstet2 has joined #pypy
oberstet has quit [Ping timeout: 240 seconds]
FASDFSF has quit [Ping timeout: 255 seconds]
Tiberium has quit [Ping timeout: 240 seconds]
Tiberium has joined #pypy
ronny has joined #pypy
<tos9> ^ arigo: thanks!
yuyichao has quit [Ping timeout: 260 seconds]
lritter_ has quit [Ping timeout: 260 seconds]
tbodt has joined #pypy
yuyichao has joined #pypy
tbodt has quit [Client Quit]
tbodt has joined #pypy
oberstet2 is now known as oberstet
Taggnostr has quit [Ping timeout: 268 seconds]
Taggnostr has joined #pypy
ramonvg has quit [Remote host closed the connection]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
nimaje1 has joined #pypy
nimaje1 is now known as nimaje
nimaje has quit [Killed (card.freenode.net (Nickname regained by services))]
pilne has joined #pypy
shodan45_ has joined #pypy
plan_rich_ has joined #pypy
chris|_ has joined #pypy
shodan45_ has quit [Remote host closed the connection]
shodan45_ has joined #pypy
ronny has quit [*.net *.split]
kanaka has quit [*.net *.split]
ionelmc has quit [*.net *.split]
DanC has quit [*.net *.split]
chris| has quit [*.net *.split]
igitoor has quit [*.net *.split]
shodan45 has quit [*.net *.split]
plan_rich has quit [*.net *.split]
chris|_ is now known as chris|
ionelmc has joined #pypy
arigato has joined #pypy
shodan45_ has quit [Remote host closed the connection]
ronny has joined #pypy
kanaka has joined #pypy
DanC has joined #pypy
kanaka has quit [Changing host]
kanaka has joined #pypy
amaury has joined #pypy
asmeurer_ has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
altendky has joined #pypy
shodan45 has joined #pypy
oberstet has quit [Ping timeout: 240 seconds]
asmeurer_ has quit [Quit: asmeurer_]
igitoor has joined #pypy
igitoor has quit [Changing host]
igitoor has joined #pypy
oberstet has joined #pypy
DragonSA has quit [Quit: Konversation terminated!]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
tbodt has quit [Read error: Connection reset by peer]
tormoz has joined #pypy
tormoz has quit [Remote host closed the connection]
rmesta1 has quit [Quit: Leaving.]
Rhy0lite has quit [Quit: Leaving]
tbodt has joined #pypy
Tiberium has quit [Read error: Connection reset by peer]
arigato has quit [Ping timeout: 240 seconds]
kenny has left #pypy [#pypy]
lapinot has joined #pypy
lapinot has quit [Client Quit]
ceridwen has quit [Read error: Connection reset by peer]
ceridwen has joined #pypy
tormoz has joined #pypy
rmesta has joined #pypy
nimaje1 has joined #pypy
nimaje1 is now known as nimaje
nimaje is now known as Guest94994
kushal has quit [Ping timeout: 260 seconds]
kushal has joined #pypy
kushal is now known as Guest62443
marky1991 has quit [Ping timeout: 246 seconds]
gsnedders has quit [Ping timeout: 260 seconds]
jamesaxl has quit [Quit: WeeChat 1.7]
vkirilichev has joined #pypy
gsnedders has joined #pypy
<kenaan> amauryfa@gmail.com default e69e22840104 /lib_pypy/: Expose win32's SetErrorMode, which is mandatory for the 3.5 test suite.
<kenaan> amauryfa@gmail.com default aa98455c75dc /lib_pypy/: Backport _pypy_winbase_build.py from the 3.5 branch, to reduce merge conflicts.
<kenaan> amauryfa py3.5 7e5247599a57 /lib_pypy/: hg merge default
marky1991 has joined #pypy
rmesta has quit [Quit: Leaving.]
kipras is now known as kipras`away
kipras`away is now known as kipras
amaury has quit [Ping timeout: 260 seconds]