[issue9141] Allow objects to decide if they can be collected by GC

2012-04-16 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I've stumbled upon further cases of this problem, and a possible serious bug in python 3. the _PyIOBase_finalize() will invoke a close method on the object if the object isn't closed. This is the same as the object having

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-16 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a patch with the suggested change. I put _PyObject_ResurrectFromDealloc into typeobject.c since it seems more at home there than in object.c, but I'm not sure. Also note that other types, that were calling

[issue14507] Segfault with starmap and izip combo

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: You are creating a 10 level nested structure of iterators. It is no wonder that you exhaust the stack space of the interpreter. You would get the same with any iterator combination, nothing special with zip and starmap here

[issue11750] Mutualize win32 functions

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: (fixed wsock32.lib in revision ab0aff639cfb) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11750

[issue14574] SocketServer doesn't handle client disconnects properly

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I think this needs serious consideration. There needs to be an socket error case cleanup path that releases resources but ignores further socket errors. -- ___ Python tracker rep

[issue10576] Add a progress callback to gcmodule

2012-04-15 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10576

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a patch that rectifies this situation, albeit in a somewhat 'hacky' manner. It works by injecting a monitoring 'tp_free' call into the type during the basedealloc call, which sets a flag if it was called with the object

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Another, less hacky but more intrusive, way would be to change the signature of tp_dealloc in a backwards compatible way: typedef void (*destructor)(PyObject *, int *destroyed); The destructor can then set the flag pointed

[issue14507] Segfault with deeply nested starmap calls

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: a = map(add, a, b) also crashes this. a = chain(a, b) also. If, by provisions you speak of sys.max_recursion_depth, that is only invoked when executing python code. What's happening here is just simple c recursion trough

[issue14507] Segfault with deeply nested starmap calls

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: On the other hand, Antoine is correct in that we _could_ use the existing infrastructure and count PyIter_Next() as a recursion in the same way as entering the ceval loop is a recursion. Extra checking in there would hardly slow

[issue11750] Mutualize win32 functions

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: at some point it became the Windows API. You are right: http://en.wikipedia.org/wiki/Windows_API How about _windowsapi or _winapi then, to ensure there are no clashes? -- ___ Python

[issue14507] Segfault with deeply nested starmap calls

2012-04-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: There are other crashers we choose to ignore (involving gc.getreferrers, bytecode hacks, ctypes, etc). I think this should go in that category and I would be happy to add a note to that effect in the docs for tertools. Yes

[issue11750] Mutualize win32 functions

2012-04-14 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- nosy: +kristjan.jonsson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11750

[issue14574] SocketServer doesn't handle client disconnects properly

2012-04-14 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- nosy: +kristjan.jonsson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14574

[issue14534] Add method to mark unittest.TestCases as do not run.

2012-04-14 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: +1, we already have such decorators for individual test cases. Code should be obvious, particularly testing code and mixins often aren't. Magic such as identifying classes to run by their type should be over rideable. All magic

[issue11750] Mutualize win32 functions

2012-04-14 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: It shouldn't. I noticed this and fixed this at CCP a while back but I wasn't in Python Committer mode at the time. _select needs fixing. -- ___ Python tracker rep...@bugs.python.org

[issue8799] Hang in lib/test/test_threading.py

2012-04-11 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: A few comments: 1) with cv: make_an_item_available() + cv.notify() 2) one of the benefits of wait_for() is that it automates the tricky timekeeping needed if one wants an somewhat accurate timeout, you may want

[issue8799] Hang in lib/test/test_threading.py

2012-04-11 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: But, once again, the condition may not yet hold true is false. In our current implementation, yes. But it is intentionally left undefined in the specification of the condition variable protocol, for very good reasons. While I'm

[issue8799] Hang in lib/test/test_threading.py

2012-04-10 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: We shouldn't be testing implementation details. The Condition variables are canonically prone to spurious wakeups and stolen wakeups. The fact that the current implementation doesn't have them shouldn't place that burden

[issue8799] Hang in lib/test/test_threading.py

2012-04-10 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Stolen wakeups are a fact of life though, even in cpython's implementation of condition variables. And for the user of a condition variable the difference is so subtle as to not warrant special mention. This is, btw, not just

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: possibly, multiprocessing.Connection uses handles, which can be socket handles on windows, and that code also uses DuplicateHandle. I think a generic solution must be found for multiprocessing, so I'll create a separate issue

[issue8799] Hang in lib/test/test_threading.py

2012-04-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a new patch. 1) I´ve simplified and relaxed test_notify() for Condition objects. Condition variables don't guarantee that there won't be any spurious wakeups so the test must maintain internal bookkeeping so

[issue4892] Sending Connection-objects over multiprocessing connections fails

2012-04-09 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- nosy: +kristjan.jonsson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4892

[issue4892] Sending Connection-objects over multiprocessing connections fails

2012-04-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I just want to point out that each time socket.share() is called, the resulting data can only be used once by socket.fromshare(). I'm mentioning this because I know there is some caching mechanism in reduction.py

[issue10576] Add a progress callback to gcmodule

2012-04-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: A new patch, taking Antoine's review and comments into account. -- Added file: http://bugs.python.org/file25158/gccallback.patch ___ Python tracker rep...@bugs.python.org http

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: multiprocessing.reduction still appears to use DuplicateHandle to copy sockets. I propose adding a pair of custom functions to _multiprocessing, that pickles and unpickles handles. It can detect socket handles as being different

[issue14288] Make iterators pickleable

2012-04-08 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14288

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Jim: The edge case of collecting an object that is alone in a cycle is something that isn't handled. I'm also not sure that it is worth doing or even safe or possible. but that is beside the point and not the topic of this patch

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Btw. tangentially related to this discussion, issue 10576 aims to make the situation with uncollectable objects a little more bearable. An application can listen for garbage collection, visit gc.garbage and deal with its

[issue14310] Socket duplication for windows

2012-04-07 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14310

[issue10576] Add a progress callback to gcmodule

2012-04-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is an updated patch, taking Jim's and Antoine's comments into account. Jim, I´d like to comment that I think the reason __del__ objects are uncollectable is more subtle than there being no defined order of calling

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: New patch with explicit mutually exclusive flags and better comments. -- Added file: http://bugs.python.org/file25142/ob_is_gc.patch ___ Python tracker rep...@bugs.python.org http

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Thanks for your comments Jim. They made me realize that the patch was incomplete. What is needed are two mutually exclusive flags that override the presence of the tp_del slot. This addresses your 1) point and is the case

[issue10576] Add a progress callback to gcmodule

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: You are right, I was thinking more of pyobject attributes. I'll fix this then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10576

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- Removed message: http://bugs.python.org/msg157189 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14310

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Not much happening on python-dev. Perhaps this is not so controversial. http://www.mail-archive.com/python-dev@python.org/msg66206.html -- ___ Python tracker rep...@bugs.python.org http

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The binary copy: This is a winsock2 feature. There is no difference in layout between 32 bits and 64 bits. I also don't think there is a difference between SDK versions. However, strangely, there is a difference between unicode

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Right Daniel, but currently an exception is made for Generator objects. The generator can tell that the finalizer won't do anything and then allow collection regardless. It knows the finalizer and that in its state

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: typeobject.c: TPSLOT(__del__, tp_del, slot_tp_del, NULL, ), I'm not super-familiar with how typeobjects and slots work, but I imagine that if a type is defined with a __del__ member, then the tp_del slot is automatically filled

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a new patch, with more tests. Note that the process worker function can't be a member function because of how multiprocessing works on Windows. -- Added file: http://bugs.python.org/file25143/duplicate.patch

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: by memberfunction I mean a member of the class. I tried staticmethod and it didn't work: I tried a staticmethod and it didn't work: == ERROR: testShare

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: Removed file: http://bugs.python.org/file25145/duplicate.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14310

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: Removed file: http://bugs.python.org/file25143/duplicate.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14310

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: But changing it to staticmethod strangely fixes it. Interesting. Sorry? Don't be, probably not your fault. Today we have learned that we can spawn multipropcessing targets with classmethods, but not staticmethods. Your patch

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Could you possibly be any more specific? It works for me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14310

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: Removed file: http://bugs.python.org/file25146/duplicate.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14310

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Well, I think I have all of the merge errors out now. You´ll forgive me if I didn't notice them all at first, but this is why we review code and you would have helped me by giving me specifics, since after a time, the eyes tend

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-05 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a completely new patch. This approach uses the already existing tp_is_gc enquiry slot to signal garbage collection. The patch modifies the generator object to use this new mechanism. The patch keeps the old

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-04 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I just noticed that PyTypeObjects have a gc slot already: inquiry tp_is_gc; /* For PyObject_IS_GC */ Now, this is used in only one place in 2.7, for type objects: return type-tp_flags Py_TPFLAGS_HEAPTYPE; This is thus used

[issue14288] Make iterators pickleable

2012-04-03 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Good idea Antoine. So, I'll with your suggested fix to the unittests I'll commit this and then look on while Rome burns. -- ___ Python tracker rep...@bugs.python.org http

[issue14471] Buffer overrun in winreg.c

2012-04-02 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Thanks. Martin, what constitutes a security fix for Python? For example, isn't it conceivable that one could place a long key into some registry setting used by python and thus interfere with its stack? Aren't stack buffer

[issue14471] Buffer overrun in winreg.c

2012-04-02 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Thanks for the your info/insight, Martin. I'll update 3.2 and 3.3. as you suggest then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14471

[issue14471] Buffer overrun in winreg.c

2012-04-02 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14471

[issue14300] dup_socket() on Windows should use WSA_FLAG_OVERLAPPED

2012-04-01 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I already included this fix in my socket share patch, see issue 14310. I think this was a bug that should be checked in to all relevant branches. The reason is this text from msdn documentation for WsaDuplicateSocket: Both

[issue14300] dup_socket() on Windows should use WSA_FLAG_OVERLAPPED

2012-04-01 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Also, see this: http://support.microsoft.com/kb/179942/EN-US applies to windows 2000 only, as far as I can tell, though. Don't know if we still support that. I have scoured the docs, but found yet no reason to _not_ use

[issue14471] Buffer oferrun in winreg.c

2012-04-01 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: I found this issue with code analyzer in VS2010. The problem applies to all 3.x versions, but there is no corresponding winreg.c file in 2.x. Since I'm not sure of the maintenance state of the individual branches, I'm creating

[issue14471] Buffer overrun in winreg.c

2012-04-01 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- title: Buffer oferrun in winreg.c - Buffer overrun in winreg.c ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14471

[issue14310] Socket duplication for windows

2012-03-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Still no responses? I'll submit this then, unless someone objects. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14310

[issue10576] Add a progress callback to gcmodule

2012-03-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Thanks, Jim. Unless anyone objects, I'll commit this then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10576

[issue9787] Release the TLS lock during allocations

2012-03-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Closing this since it applies only to our custom tls implementation. Most platforms use native tls now. -- resolution: - wont fix status: open - closed ___ Python tracker rep

[issue10576] Add a progress callback to gcmodule

2012-03-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Thank you Antoine. Your points: - Yes, I can robustify this. - I think I worried that the actual contents might be too complex to test for it. I'll see if I can't just simplify it as you suggest. - right, thanks. - gc.callbacks

[issue14310] Socket duplication for windows

2012-03-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: You are right, I was thinking more of pyobject attributes. I'll fix this then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14310

[issue13210] Support Visual Studio 2010

2012-03-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Why should python compiled with VS2010 have different error codes than one compiled with the older compilers? We could revisit this in a new python version, but for now, we should maintain compatibility across compilers

[issue14435] Remove special block allocation from floatobject.c

2012-03-30 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: All done. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14435

[issue14435] Remove special block allocation from floatobject.c

2012-03-29 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: floatobject.c has its own block allocator. This appears to be ancient, from before the time when obmalloc.c was invented. This patch removes this allocator and puts an upper limit on the freelist of floats. The purpose

[issue14435] Remove special block allocation from floatobject.c

2012-03-29 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Yes, it is supposed to, but no one is actually looking at that value. It was used in debugging information during PyFloat_Fini() which is no longer relevant if this block information is removed. Sure, 100 or 10 does not matter

[issue14435] Remove special block allocation from floatobject.c

2012-03-29 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Correction: The number returned was the number of floats in existence, not the size of the freelist. Do you think I should add a counter to support that functionality? I´d rather change it to be the size of the old freelist

[issue14435] Remove special block allocation from floatobject.c

2012-03-29 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a new patch, with the suggested changes. The variable names and macros are similarly named as those for other objects such as lists. -- Added file: http://bugs.python.org/file25071/nofreelist.patch

[issue14288] Make iterators pickleable

2012-03-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Okay, I'll go ahead, fix the 'iter()' trick api name and apply the patch. Then we'll see what happens :). Any suggestion towards what documentation changes are needed? I don't think the list of pickleable objects is made

[issue14288] Make iterators pickleable

2012-03-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Raymond had already reviewed it, and sbt. I wasn't aware of any more pending reviews, but I'll wait for yours, of course. -- ___ Python tracker rep...@bugs.python.org http

[issue14288] Make iterators pickleable

2012-03-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Btw, regarding compatibility: The docs say The pickle serialization format is guaranteed to be backwards compatible across Python releases. I take this to mean the serialization format itself. I don't think there is a broader

[issue14288] Make iterators pickleable

2012-03-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I've incorporated antoine's comments and the proposed internal function name into a new patch. A lot of the changes concerned thecking the type() of the unpickled iterator. Now, it wasn't a specific design goal to get the exact

[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I don't quite understand what you're saying about line mismatch Victor. Anyway, if you look at it, it is clear that: 1) sys_update_path() can be called with argc==0 (main.c line 647) 2) 1742 was always setting arg0 to argv[0

[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I'm sure you didn't intend to use words such as wrong and useless Victor. Perhaps n must be 0 even for argc0, but I did that as an afterthought. Which is the reason I asked you to take a look rather than committing this right

[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: You are right, Stefan, argv[argc] is defined to be NULL by the standard. Jolly good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3367

[issue9609] make cProfile multi-stack aware

2012-03-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I've presented the patch, but no one has voiced an opinion on it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9609

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Why do you think it isn't safe, Antoine? We only support IEEE platforms, and IEEE defines positive 0.0 to be all bits cleared. I personally don't think that even a small measurable performance degradation in creating new floats

[issue14310] Socket duplication for windows

2012-03-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: So, what is the consensus, does this go in or out? What about the share() and fromshare() functions, are people ok with that? -- versions: +Python 3.3 -Python 3.4 ___ Python tracker rep

[issue14288] Make iterators pickleable

2012-03-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: sbt, I will fix the api name. Any other objections then? Leave it as it is with the iter() trick? -- versions: +Python 3.3 -Python 3.4 ___ Python tracker rep...@bugs.python.org http

[issue13210] Support Visual Studio 2010

2012-03-23 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Adding a patch to disable Side by Side assemblies in VS2010 (MS saw the light) -- keywords: +patch Added file: http://bugs.python.org/file25003/sxs.patch ___ Python tracker rep

[issue13210] Support Visual Studio 2010

2012-03-23 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a comprehensive patch to errnomodule.c, as used in production at CCP -- Added file: http://bugs.python.org/file25004/errnomodule.diff ___ Python tracker rep...@bugs.python.org

[issue13210] Support Visual Studio 2010

2012-03-23 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Adding a patch containing a proposed PCBuild10 folder. This consists of: 1) automatically updated .vcxproj and .sol files, provessed by 3) below 2) manually edited and new .props files to edit TargetName and Extension attributes 3

[issue4024] float(0.0) singleton

2012-03-22 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- superseder: - Intern certain integral floats for memory savings and performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4024

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Yes, there is a measurable performance decrease in pybench arithmetic tests. Integers don't fall out of arithmetic that often, true. But integral floats are incredibly common in tabular data. In a game such as Eve Online

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The -10..11 range was determined empirically. As you see from the values, only -10 shows up as significant... In fact, just storing 0 to 5 would capture the bulk of the savings. Right, I'll do some test with the hardcoded

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: PyFloat_FromString() is very restrictive. In our case, for example, the floats in question don't come from text files. I'm adding a new file with changes suggested by Antoine. only 0.0 and 1.0 are interned. It turns out

[issue10538] PyArg_ParseTuple(s*) does not always incref object

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Adding a patch here. -- keywords: +patch Added file: http://bugs.python.org/file24995/#10538.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10538

[issue14307] Make subclassing SocketServer simpler for non-blocking frameworks

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: What's wrong with making functionality overridable, Antoine? By all means, let's keep the select() but allow subclasses to elect not to use it. As for the wakeup fd, there isn't such a thing. Why object on the basis

[issue10538] PyArg_ParseTuple(s*) does not always incref object

2012-03-22 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10538

[issue3367] Uninitialized value read in parsetok.c

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Victor, could you check out the last patch here for sysmodule? I gather that you are familiar with it. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue14387] Include\accu.h incompatible with Windows.h

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Now unicodedata.c does not compile with VS2010, because somewhere, small is defined. Do you mind if I change the _PyAccu.small member to 'smalls'? -- nosy: +krisvale ___ Python tracker

[issue14387] Include\accu.h incompatible with Windows.h

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Sure, that's simpler. I'll submit a fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14387

[issue10142] Support for SEEK_HOLE/SEEK_DATA

2012-03-21 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- nosy: -krisvale ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10142 ___ ___ Python

[issue9787] Release the TLS lock during allocations

2012-03-21 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Making this low priority since it applies only to platforms without Windows and pthread support. -- priority: normal - low versions: +Python 3.3 -Python 3.2 ___ Python tracker rep

[issue3367] Uninitialized value read in parsetok.c

2012-03-21 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a patch for the sysmodule.c problem -- Added file: http://bugs.python.org/file24983/sysmodule.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3367

[issue3367] Uninitialized value read in parsetok.c

2012-03-21 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3367

[issue10469] test_socket fails using Visual Studio 2010

2012-03-21 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Added a patch as used by CCP in production. Covers more WSA cases. -- nosy: +krisvale Added file: http://bugs.python.org/file24985/cpython_75849_to_75851.diff ___ Python tracker rep

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-21 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: Michael Foord reminded me of this issue recently. It was discussed on pydev a few years back and met with limited enthusiasm. I speak from experience in live production with EVE that this simple change saved us a lot of memory

[issue3367] Uninitialized value read in parsetok.c

2012-03-20 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: bump, what is the status of this? Was it fixed? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3367

[issue14198] Backport parts of the new memoryview documentation

2012-03-20 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Stefan, I just want to point out this issue, if you are touching 2.7: http://bugs.python.org/issue10538 Do you think it merits being fixed? -- nosy: +krisvale ___ Python tracker rep

<    1   2   3   4   5   6   7   8   9   10   >