[issue10501] make_buildinfo regression with unquoted path

2010-11-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Ah yes, spaces in filenames. One always forgets. Fixed the make_buildinfo.c (quote whole string, not just part of it) and committed in revision 86689 -- resolution: - accepted status: open - closed

[issue10501] make_buildinfo regression with unquoted path

2010-11-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I did various tests and quoting parts of the path seemed fragile, especially if the quote landed next to a backslash. This is dangerous ground :) -- ___ Python tracker rep

[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Found the issue and it wasn't with sha1. Turned out that the code was doing somethign like sha1(buffer(unicode('str'))) which exposed the endianness of the unicode representation. Sorry for wasting your time. -- resolution

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

2010-11-26 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: The new s* code for PyArg_ParseTuple is used to fill a Py_buffer object from the arguments. This object must be relased using PyBuffer_Release() after use. However, if the object in the tuple does not support the new buffer

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

2010-11-26 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10538

[issue10553] Add optimize argument to builtin compile() and byte-compilation modules

2010-11-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: This looks fairly complete. I spotted the word optimze in there :) As for the C api, I always cringe when I add an Ex function myself, because it feels like I'm spending my last bullet. What to do if I need yet another parameter

[issue10576] Add a progress callback to gcmodule

2010-11-29 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: As discussed here: http://mail.python.org/pipermail/python-ideas/2010-November/008813.html: Adding the ability to register callbacks to be invoked before and after garbage collection runs. This can be used to gather run-time

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Hi, as I stated, the original patch was simply our original implementation. Here is a new patch. It is simpler: 1) it exposes a gc.callbacks list where users can register themselves, in the spirit of sys.meta_path 2) One can have

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: You are right, Antoine. How about a string and a dict? the string can be start and stop and we can add interesting information to the dict as you suggest. -- ___ Python tracker rep

[issue10576] Add a progress callback to gcmodule

2010-12-03 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: 1) I'm not sure what you are asking. Does anyone think that it is simpler to register two different callbacks than one? IMHO it complicates the interface and creates so many oppertunities to do things incorrectly. 2

[issue10576] Add a progress callback to gcmodule

2010-12-05 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a third patch. The callback now gets two argument, phase and info. I've added documentation and unittests. -- Added file: http://bugs.python.org/file19946/gccallback3.patch

[issue8194] Incompatible API change in xmlrpclib.Transport.parse_response() of Python 2.7 and 3.2

2010-12-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The patch looks fine to me. If it runs and everyone is happy, by all means lets put it in. (I agree that the zlib stuff _should_ be handled elsewhere, but for reasons of expediency it was put into this module

[issue10683] PreLinkEvent error under VC2010

2010-12-12 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Yes, I have VC2010 so I'll see what happens... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10683

[issue10683] PreLinkEvent error under VC2010

2010-12-12 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Ok the problem is this line in the pre-link step, that must have gotten changed during the conversion: $(SolutionDir)make_buildinfo.exe Debug $(IntDir) should be $(SolutionDir)make_buildinfo.exe Debug $(IntDir)\ This is because

[issue10683] PreLinkEvent error under VC2010

2010-12-12 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Implemented the trailing quote removal defensive programming strategy in revision 87205. Others that autoconvert the solution will not be hit by this problem. -- resolution: - fixed status: open - closed

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

2010-12-15 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Well, I can submit a patch if anyone is interested. I came across this when writing asynchronous network code. By hanging onto the Py_buffer, I should have access to the data during the network call. But it only worked for true

[issue10576] Add a progress callback to gcmodule

2010-12-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Uh oh. I forgot about this and there now we have passed beta 2. Didn't anyone want to review the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10576

[issue10576] Add a progress callback to gcmodule

2010-12-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Well, the idea is good and it did cross my mind. Particularly it could be useful for performance sensitive applications. However it complicates things. 1) If a GC is rejected, when do we make the next attempt? 2) If a callback

[issue10576] Add a progress callback to gcmodule

2010-12-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: 1) what I mean is that if a callback rejects GC, the GC algorithm may find its condition for invoking GC in the first place to be still valid immediately afterwards, so doing a GC will be immediately retried. I have to check

[issue10296] ctypes catches BreakPoint error on windows 32

2010-12-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I _think_ that in our old 2.5 python (which had a backported ctypes from 2.6 to support 64 bits) we always got the JIT debugger i.e. with _ctypes.pyd and _ctypes_d.pyd. This api, DebugBreak always invokes the JIT debugger

[issue11034] Build problem on Windows with MSVC++ Express 2008

2011-01-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Bizarre indeed. I think more quotes is the answer, since it is simpler to implement. But the question remains, why has it worked until now? -- ___ Python tracker rep...@bugs.python.org

[issue8777] Add threading.Barrier

2010-05-20 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: The barrier synchronization primitive is often very useful. It is simpler to use than an Event, for example, when waiting for threads to start up, or to finish. The patch contains a simple barrier implementation based

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

2010-05-24 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: The tests for the ConditionVariable a fragile. On a slow computer, or when running a DEBUG build, the main thread can issue a condition.notify() call, even though the worker threads have not settled in on a wait() call

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

2010-05-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Well, I saw this occasionally on my dual core laptop when working on the RWLock. A notify() before a target does a wait() is ineffective and it would wait indefinitely after the notify(5) call. This isn't a proper fix (I had

[issue8777] Add threading.Barrier

2010-05-25 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I'll provide a new version shortly, targeted for the py3k branch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8777

[issue8832] automate minidom.unlink() with a context manager

2010-05-27 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: It is all to easy to forget to unlink() minidom documents resulting in huge memory usage. This patch allows to automate that process with a context manager, similar to how files can be closed in the same way

[issue8832] automate minidom.unlink() with a context manager

2010-06-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Any comments? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8832 ___ ___ Python

[issue8832] automate minidom.unlink() with a context manager

2010-06-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Thank you all. I updated the unittest, and committed this in: revision: 81856 -- stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8832

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

2010-07-02 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: The GC module currently relies only on the presence of a __del__ method to decide if an object can be safely collected at all. Also, there is a special case for generator objects. This patch allows any object to call an api

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

2010-07-02 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: 1. The use case is any C extension that may need to run non-trivial code when being deleted, but where this can not be statically known. An example in the code today is generators, and the PyGen_NeedsFinalizing() function, doing

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

2010-07-04 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I don't understand the tp_del / tp_dealloc argument here. This is really not the concern of gc. Gc only goes and finds unreachable objects, and if they are deemend collectable, makes them go away by clearing their references. GC

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

2010-07-04 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I'm confused, Antoine. _I_ am not preferring anything. I am not modifying the way finalizers are called. I'm merely providing a way for objects to signal that they _have_ (or don't have) non-trivial finalizers. A finalizer

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

2010-07-04 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: tp_del() is generally invoked by tp_dealloc(). See for example typeobject.c:849. gc.collect() never invokes tp_del() directy, that is left for the objects themselves (as part of tp_dealloc()) Now, gc already knows

[issue8946] PyBuffer_Release signature in 3.1 documentation is incorrect

2010-07-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The documentation issue appears present in 2.7 (and 2.6). Further, the Py_buffer member 'obj' is undocumented, and the in-line comment in object.h falsely states that it is a borrowed reference, whereas PyBuffer_Release

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

2010-07-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Hi Antoine. I am not adding another traversal pass. I am modifying the function that gets called for every object about to be collected, to call the object's traversal function. This is hardly an extra pass and is done only

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

2010-07-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Hi Daniel. Your message was classified as spam, I have no idea why, but this is why I only noticed it now. Your suggestion is interesting, I hadn't thought of that. Yes, it is possible to use the track/untrack functions (I think

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

2010-07-20 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I agree that this is not the _optimal_ solution, and that when you are collecting stuff, say a list of many items, it will cause X indirect calls to all of the things in the list. My counterargument is, however, that all those

[issue9417] Declaring a class creates circular references

2010-07-29 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Interesting. Here is a case for disabling GC: We intentionally disable GC in Eve-online, because of the unpredictable lag spikes it produces. In a server application with gigabytes of python objects, GC can cause hickups

[issue8299] Improve GIL in 2.7

2010-08-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Although I did finally manage to explain the point of this patch (after a long, long discussion), I think the issue is still too controversial. We did, for example, see some strange behaviour in my last comment (Date: 2010-04-21

[issue8411] Improve condition variable emulation on NT

2010-08-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The latter. But I'd really like Antoine to look this over. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8411

[issue7464] circular reference in HTTPResponse by urllib2

2010-08-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: in python/trunk/Lib/urllib2.py, line 1161 It doesn't appear to be an issue in py3k. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7464

[issue9417] Declaring a class creates circular references

2010-08-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: What about my suggestion of simply providing a convention on how to disable links manually, similar to how minidom.document does it with an unlink method? If these cases are documented, then there shouldn't be any extra bother

[issue8411] Improve condition variable emulation on NT

2010-08-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Thanks for your comments. The problem with _cond_timed_wait indicates that the timed wait code hadn't been thoroughly tested at the time of submission. 1) The InterlockedDecrement was left in by mistake. It must be removed 2

[issue8411] Improve condition variable emulation on NT

2010-08-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: this is a critical lock should read this is a critical moment :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8411

[issue8411] Improve condition variable emulation on NT

2010-08-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Updated patch file -- Added file: http://bugs.python.org/file18442/nt_cond2.path ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8411

[issue8411] Improve condition variable emulation on NT

2010-08-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: You wan't to have the Semaphore with a max count of infinite because a) of the race condition mentioned (actually, possible discrepancy between n_waiting and actual semaphore value), which can cause the semaphore count

[issue5804] Add an 'offset' argument to zlib.decompress

2010-08-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: decompressobj is indeed enough. But if you are doing a lot of this (decompressing chunks), then using the unused_data, as it is, involves a lot of copying. If there were a unused_data_pos or some equivalent, then it would

[issue8411] New GIL: improve condition variable emulation on NT

2010-08-10 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Great. I hope you agree that it is simpler. I'm afraid my explanations can be somewhat long-winded so I hope you found a better way to document my pseudo race condition. -- status: pending - open

[issue9587] unittest.assertRaises() return the raised exception

2010-08-13 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: That was a bit abrupt, want't it? Denver is well aware of this and said: but sometimes using the context manager approach adds unnecessary bloat to already long-winded unit tests. I happen to agree with him and don't see why we

[issue9609] make cProfile multi-stack aware

2010-08-15 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: One of the problems with the profiling modules provided with Python is that they are not useful in the presence of multiple threads. This is because time spent in a different thread may be falsely attributed to some random

[issue9587] unittest.assertRaises() return the raised exception

2010-08-16 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Pehaps it hasn't been demonstrated before, but just for the sake of argument (and because I'm a persistant bugger), here are the two different cases: current: ctxt = self.assertRaises(MyException) with ctxt: foo

[issue9622] Allow to set profile/trace function globally

2010-08-16 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: issue 9609 updates _lsprof.c to be multi-stack aware. This allows cProfile.Profile() objects to be shared by many threads and provide meaningfull results. This update makes it more convenient to profile running, multi-threaded

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Good question. Is that simple to do? I didn't think to look if there were a central list of all python TLS states. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Sounds like a much simpler change. I'll try that out instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9622

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a new, much simpler patch, which simply sets the flags on all the threads (accessable as a linked list of PyThreadState objects) as suggested by Antoine. (Note that neither of the patches has the necessary enhancements

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Indeed it is. This is a remnant of the previous method. I will fix it, and add documentation. I also think I'll leave the change to _lsprof out of this so that this change can stand on its own, irrespective of the profiling

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I just realized that this is probably a redundant change. We have C apis to get all the Thread states in an interpreter state (I didn't even know there was such a thing as multiple interpreter states

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Setting this to invalid, since there already are APIs to do this, at least from .py code. -- resolution: - invalid ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue9425] Rewrite import machinery to work with unicode paths

2010-08-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Yes. in #1552880 I tried to make as minimal a change as possible. This particular patch is still in use in EVE Online, which is installed in various strange and exotic paths in the orient.. The trick I employed

[issue1552880] Unicode Imports

2010-08-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Possibly. I made a comment in issue 9425 explaining the particular trick that this here patch makes (using utf-8 as an intermediate form to avoid having to change all the machinery in import.c

[issue1552880] Unicode Imports

2010-08-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I conffess that I didn't follow the utf-8/surrogate discussion. But the utf-8 encoding can encode all valid unicode characters: UTF-8 may only legally be used to encode valid Unicode scalar values. According to the Unicode

[issue1552880] Unicode Imports

2010-09-01 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Yes, but in Python, U+DC80..D+DCFF range is used to store undecodable bytes. Eg. 'abc\xff'.decode('ascii', 'surrogateescape') gives 'abc\udcff'. That's an inventive way of breaking the unicode standard :) Anyway, why would you

[issue1552880] [Python2] Use utf-8 in the import machinery on Windows to support unicode paths

2010-09-05 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Well, it was, originally, but it met with so little interest that I couldn't be bothered to polish it to inclusion standards. Anyway, there was the incompatibility problem of what to do with the __file__ attribute, and the fact

[issue9786] Native TLS support for pthreads

2010-09-06 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: The following patch adds native TLS implementation for pthreads, avoiding the relatively slow and clunky default tls implemented in thread.c -- components: Interpreter Core files: pthread_tls.patch keywords: needs review

[issue9787] Release the TLS lock during allocations

2010-09-07 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: Holding the keymutex lock during malloc and free operations is not a good idea. The reason is, that custom implementations of malloc and free, can use the TLS themselves. This is, for example, true in embedded situations

[issue9786] Native TLS support for pthreads

2010-09-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The code may need a little bit of extra work: The pthreads machine that I have to work with is a PS3 :). And, despite the documentation not saying, I suspect that pthread_getspecific() actually does mess with errno, making

[issue9787] Release the TLS lock during allocations

2010-09-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: You're right. Added a new version of the patch. -- Added file: http://bugs.python.org/file18793/tlspatch.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9787

[issue9786] Native TLS support for pthreads

2010-09-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: errno is preserved by PyEval_RestoreThread(), so this isn't the issue. What you are probably seeing is latent race conditions in the test suite, made apparent by a non-locking TLS implementation. The test suite isn't free from

[issue9786] Native TLS support for pthreads

2010-09-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Hm, both the test you mention are using the (non-recursive) lock to synchronize threads. I can't see anything wrong there. Could you please try to replace the cod in pthread_getspecific() with this: int err = errno void *result

[issue9786] Native TLS support for pthreads

2010-09-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Ah, good to hear. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9786

[issue9609] make cProfile multi-stack aware

2010-09-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a new patch. When 'allthreads' is specified to cProfile.Profile.enable(), profling is enabled on all threads. The testsuite tests to see that all threads do indeed register, it does not attempt to validate the timings

[issue9786] Native TLS support for pthreads

2010-09-12 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I left the ifdef in for a quick and easy way to disable this code for those interested, but I'm happy to remove it if it makes for greater synergy. -- ___ Python tracker rep

[issue9787] Release the TLS lock during allocations

2010-09-12 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: You may find this hard to believe, but we do in fact embed python into other applications. In this case, it is UnrealEngine, to drive a complex, console based game. Yes, embedding python is much harder than it need be and I'll

[issue9787] Release the TLS lock during allocations

2010-09-12 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I forgot to add: The API that our (instrumented) malloc implementation is calling is: PyGILState_GetThisThreadState(); -- ___ Python tracker rep...@bugs.python.org http

[issue9786] Native TLS support for pthreads

2010-09-12 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Added a new patch with #ifdef remvoved, for greater harmony. -- Added file: http://bugs.python.org/file18864/pthread_tls.patch ___ Python tracker rep...@bugs.python.org http

[issue9787] Release the TLS lock during allocations

2010-09-13 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The malloc implementation just has no business looking at the thread state. Of course it does, if it you want to have any hope of instrumenting your python memory usage with detailed python runtime information. Your statement

[issue9786] Native TLS support for pthreads

2010-09-13 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I've changed the function as you suggest, although there are in fact no failure detection semantics defined for PyThread_create_key(). See e.g. thread.c:294 /* Return a new key. This must be called before any other functions

[issue9786] Native TLS support for pthreads

2010-09-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Ok, here is a patch. key creation returns -1 on error, and the caller can detect this and raise a fatal error. -- Added file: http://bugs.python.org/file18906/pthread_tls.patch

[issue9786] Native TLS support for pthreads

2010-09-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Committed as revision 84914 -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9786

[issue9910] Add Py_SetPath API for embeddint python

2010-09-21 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: When calling Py_Initialize() from an embedding application, there is currently no way for the application to override Python's initial settin g of sys.path. An elaborate mechanism in getpathp.c kicks in, guessing the path based

[issue9910] Add Py_SetPath API for embeddint python

2010-09-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Right, forgot about getpath.c. Added documentation. See the latest version of the patch. Please note that I was unable to test the non-windows compile. -- Added file: http://bugs.python.org/file19003/py_setpath.patch

[issue9910] Add Py_SetPath API for embedding python

2010-09-24 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- title: Add Py_SetPath API for embeddint python - Add Py_SetPath API for embedding python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9910

[issue9910] Add Py_SetPath API for embedding python

2010-09-25 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Sorry, my mistake, I work in a mixed environment. If there are no objections, I´ll submit this (with fixed whitespace) -- ___ Python tracker rep...@bugs.python.org http

[issue9910] Add Py_SetPath API for embedding python

2010-09-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Completed in revision 85028 -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9910

[issue9974] tokenizer.untokenize not invariant with line continuations

2010-09-28 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/issue9974 ___ ___ Python-bugs

[issue9981] let make_buildinfo use a temporary directory on windows

2010-09-29 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: make_buildinfo currently creates temporary files getbuildinfo2.c and getbuildinfo.o in the current build directory. This update allows the caller to specify a temp directory to put those files in. The PCBuild pythoncore.vcproj

[issue9981] let make_buildinfo use a temporary directory on windows

2010-09-29 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Ooops, here is the patch. -- keywords: +patch Added file: http://bugs.python.org/file19056/make_buildinfo.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9981

[issue9974] tokenizer.untokenize not invariant with line continuations

2010-10-01 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Interesting, is that a separate defect of doctest? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9974

[issue8777] Add threading.Barrier

2010-10-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Hi, I had forgotten about this. I went back to the drawing board and had almost completed a new version. Looking at the Java barrier shows how one can go overboard with stuff. My though with the barrier is to provide a simple

[issue8777] Add threading.Barrier

2010-10-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Okay, here is a new submission. I've redesigned it to be more reminiscent of the Java version, by allowing the barrier to have a Broken state and raising a BrokenBarrierError. I've also redesigned the mechanism from a simple

[issue10211] BufferObject doesn't support new buffer interface

2010-10-27 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: The BufferObject in 2.7 doesn't support the new buffer interface. This makes it useless for use with the new memoryview object. This simple patch adds that support. -- components: Interpreter Core files

[issue10212] struct.unpack and cStringIO.StringIO don't support new buffer

2010-10-27 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: When doing socket IO, it is beneficial to use a bytearra() and then using sock.recv_into() to avoid moving data about. However, many useful functions still don't accept new style buffers, such as the bytearray and memoryview

[issue10211] BufferObject doesn't support new buffer interface

2010-10-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Do you mean that we should disable writing for the new style buffer interface? Currently the patch respects the Buffer object's read-only flag (self-b_readonly): static int buffer_getbuffer(PyBufferObject *self, Py_buffer *buf

[issue10212] struct.unpack and cStringIO.StringIO don't support new buffer

2010-10-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I disagree. It's not a new feature. We're merely completing an old feature (adding new-style buffers from 3.x to 2.7) that wasn't fully implemented. by the core. The new buffer isn't accepted in a lot of places where you'd

[issue8777] Add threading.Barrier

2010-10-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: ping? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8777 ___ ___ Python-bugs

[issue8777] Add threading.Barrier

2010-10-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Right. The condition object change is necessary to have timeout work. I can remove that feature, and slate it for another day. Add a separate patch for a Condition.wait() return value. All of the other apis are able to let

[issue10218] Add a return value to threading.Condition.wait()

2010-10-28 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: Add a return value to Condition.wait() that can be used to tell if Condition.wait() returns due to a timeout effect. This mirrors other wait apis in threading.py -- components: Library (Lib) files: condwait.patch

[issue8777] Add threading.Barrier

2010-10-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is an updated patch. It contains documentation. ReStructured isn't my Forte, and I don't know how to verify that it is correct, so please review it for me. -- dependencies: +Add a return value

[issue8777] Add threading.Barrier

2010-10-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Right. I've provided more text for the return value and provided an example. I´ve changed all three to properties, the locking wasn't really required for waiting(). I added some extra tests for the properties. -- Added

[issue8777] Add threading.Barrier

2010-10-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Committed as revision 85878 -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8777

  1   2   3   4   5   6   7   8   9   10   >