[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-17 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: It turns out my proposed patch is incorrect anyway - it will do the wrong thing if a thread *other* than the one doing the fork is in the middle of a nested import at the time the fork occurs. With issue 7242 establishing that the current

[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-17 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On further further reflection - I'm back to thinking my patch is correct. With the way fork is now implemented, the forking thread *always* holds the import lock, so the assumption in my patch regarding the meaning of the nesting level

[issue9157] Allow inspection of used decorators on a function

2010-08-21 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: How? It was easy for wraps to add the __wrapped__ attribute, since it has access to both the wrapping function and the function being wrapped. But it hasn't got a clue as to the identity of the decorator that is applying the wrapper. Absent

[issue9157] Allow inspection of used decorators on a function

2010-08-22 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: That's a lot of boilerplate for minimal gain. The Django commenter was right - proposals that start with everybody in the world needs to do X differently from the way they do it now for this to be useful aren't ever likely to gain much

[issue9251] Test for the import lock

2010-08-22 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: With the new setUp and tearDown methods, the threadedimp2 patch doesn't apply cleanly any more. Looks good and passes for me - fixed patch attached. Was I meant to still be looking at mtimport or threadimp, or have both of those been applied

[issue1284670] Allow to restrict ModuleFinder to get direct dependencies

2010-08-22 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The generalist in me is inclined to suggest a depth parameter (with depth=1 equivalent to direct dependencies only, and depth = None meaning all dependencies), but I must admit I don't have a concrete use case for the extra generality. So

[issue1284670] Allow to restrict ModuleFinder to get direct dependencies

2010-08-22 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Although I do find it a little concerning that there is no mention of sys.path_hooks or sys.meta_path in the modulefinder source code. I suspect this module only works correctly with vanilla filesystem based imports and can't handle anything

[issue9657] Add circular imports test

2010-08-22 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: It would be good if the test timed out rather than deadlocking in the face of a broken import lock. I suggest: 1. Make the two test threads daemon threads 2. Specify a timeout to the join() calls 3. Use self.assertFalse(t1.is_alive

[issue9657] Add circular imports test

2010-08-22 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Both good points - don't worry about it then. +1 to add to the test suite as-is. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9657

[issue1868] threading.local doesn't free attrs when assigning thread exits

2010-08-30 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1868 ___ ___ Python-bugs-list mailing

[issue9727] Add callbacks to be invoked when locale changes

2010-08-31 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: As part of the PEP 384 discussion, it was noted that one of the problems with mixed C runtimes on Windows is that each C runtime in the process has it's own idea of the current locale setting. This can be addressed to some degree by having

[issue8649] Py_UNICODE_* functions are undocumented

2010-09-03 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: For this one, I suggest adding something to http://docs.python.org/dev/c-api/unicode.html#plain-py-unicode -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue9755] Fix refcounting details in Py3k C API documentation

2010-09-03 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: As noted in [1] the refcount data for the C API documentation is contained in a separate file at Doc/data/refcounts.dat. This file is not mentioned in Documenting Python and hence has not been correctly updated for Py3k (e.g. none

[issue9755] Fix refcounting details in Py3k C API documentation

2010-09-03 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - d...@python nosy: +d...@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9755

[issue9789] Explicit buffer release for memoryview objects

2010-09-07 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: memoryview objects currently offer no way to explicitly release the underlying buffer. This may cause problems for mutable objects that are locked while PEP 3118 buffer references remain unreleased (e.g. in 3.2, io.BytesIO supports

[issue9789] Explicit buffer release for memoryview objects

2010-09-07 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The test suite actually does force a GC collection cycle, so the test may be more portable than I first thought, but the need to do that suggests an explicit buffer release API may be a more appropriate solution

[issue9789] Explicit buffer release for memoryview objects

2010-09-07 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Thanks for that link. Compared to what either of us managed in the original thread, I think my first post here better articulates why the ability to explicitly release the buffer is important - not because of general memory usage, but because

[issue9789] Explicit buffer release for memoryview objects

2010-09-07 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9789

[issue9789] Explicit buffer release for memoryview objects

2010-09-07 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- superseder: - Add context manager protocol to memoryviews ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9789

[issue9757] Add context manager protocol to memoryviews

2010-09-07 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I closed 9789 as a duplicate of this. Bringing the details from that issue over here: memoryview objects currently offer no way to explicitly release the underlying buffer. This may cause problems

[issue9757] Add context manager protocol to memoryviews

2010-09-07 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Is this not covered by PEP 3118 at all? The PEP says “this memory view object holds on to the memory of base [i.e. the object the buffer was acquired from] until it is deleted”. Apparently issues pertaining to delayed garbage collection

[issue9757] Add context manager protocol to memoryviews

2010-09-08 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On an eyeball review, the structure of do_release seems a little questionable to me. I'd be happier if view.obj and view.buf were copied to C locals and then set to NULL at the start of the function before any real work is done. I believe

[issue9757] Add context manager protocol to memoryviews

2010-09-08 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: One other question: should IS_RELEASED use || rather than ? Is there any case where either of those pointers can be NULL and we still want to continue on rather than bailing out with a ValueError

[issue9757] Add context manager protocol to memoryviews

2010-09-09 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Sounds good - I'd say just commit whenever you're happy with it then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9757

[issue9716] The inittab modules cannot be packages

2010-09-13 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I assume Brett marked this 3.x only because we currently don't support builtin packages at all, so making this work crosses way over into feature request territory. That makes it unsuitable for a branch in maintenance mode (i.e. 2.7). Added

[issue8077] urlparse

2010-09-15 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- title: cgi handling of POSTed files is broken - urlparse ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8077

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-16 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: As per python-dev discussion in June, many Py3k APIs currently gratuitously prevent the use of bytes and bytearray objects as arguments due to their use of string literals internally. Examples: urllib.parse.urlparse urllib.parse.urlunparse

[issue9886] Make operator.itemgetter/attrgetter/methodcaller easier to discover

2010-09-17 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: The observation has been made that there are some idioms related to key functions passed to various methods and functions that aren't particularly easy to discover. One suggestion is to create a key function glossary entry that provides

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-17 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: From the python-dev thread (http://mail.python.org/pipermail/python-dev/2010-September/103780.html): == So the domain of any polymorphic text manipulation functions we define would be: - Unicode strings - byte sequences where

[issue6627] threading.local() does not work with C-created threads

2010-09-17 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Swapnil's analysis looks correct to me - there are certain rules you have to follow before calling back into the Python interpreter core. If you don't follow them, the behaviour you will get is completely undefined. If the problem still

[issue6627] threading.local() does not work with C-created threads

2010-09-17 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The suggestion in http://bugs.python.org/issue6627#msg116722 is a good one. This a case where the user may legitimately not realise that threading.local is stored in the *temporary* state created by ctypes rather than in something more

[issue9360] nntplib cleanup

2010-09-19 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: To make the distinction easier to remember, would it help if the methods that are currently set to return bytes instead accepted the typical encoding+errors parameters, with parallel *b APIs to get at the raw bytes? My concern

[issue1866] const arg for PyInt_FromString

2010-09-20 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I'm rejecting this due to the effect it has on the output parameters. The patch ends up have to stick (char *) casts in several places because a pointer into the string provided via the char * input parameter is returned by each affected API

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-20 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The design approach (at least for urllib.parse) is to add separate *b APIs that operate on bytes rather than implicitly allowing bytes in the ordinary versions of the function. Allowing programmers to manipulate correctly encoded (and hence

[issue6627] threading.local() does not work with C-created threads

2010-09-21 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On Tue, Sep 21, 2010 at 2:39 PM, Swapnil Talekar rep...@bugs.python.org wrote: Swapnil Talekar swapnil...@gmail.com added the comment: Nick, the last statement, While this is correct for most purposes, it does mean that... can be simplified

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-09-21 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I've thought about this in the past, but never really pursued it due to the question of what to do with the __main__ namespace. There are three options here: 1. Use runpy.run_module to run the module in a fresh __main__ namespace 2. Use

[issue9790] ntpath contains imports inside functions

2010-09-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Yeah, I realised shortly after I sent my email in response to the checkin that the original version was covering more cases in that first try-block. I'll defer to you when it comes to exactly which case that NotImplementedError was covering

[issue9943] TypeError message became less helpful in Python 2.7

2010-09-26 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Having seen the reversion go by on the checkins list, I think there are distinctions the interpreter should be making here in order to improve the error messages, but it isn't. Ideally, we want to be able to tell the user (without writing War

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Attached patch is a very rough first cut at this. I've gone with the basic approach of simply assigning the literals to local variables in each function that uses them. My rationale for that is: 1. Every function has to have some kind

[issue9969] tokenize: add support for tokenizing 'str' objects

2010-09-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Possible approach (untested): def get_tokens(source): if hasattr(source, encode): # Already decoded, so bypass encoding detection return _tokenize(io.StringIO(source).readline, None) # Otherwise attempt to detect

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: A possible duck-typing approach here would be to replace the instance(x, str) tests with hasattr(x, 'encode') checks instead. Thoughts? -- ___ Python tracker rep...@bugs.python.org http

[issue9969] tokenize: add support for tokenizing 'str' objects

2010-09-29 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: As per Antoine's comment on #9873, requiring a real string via isinstance(source, str) to trigger the string IO version is likely to be cleaner than attempting to duck-type this. Strings are an area where we make so many assumptions about

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-29 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Agreed - I think there's a non-zero chance of triggering the str-path by mistake if we try to duck-type it (I just added a similar comment to #9969 regarding a possible convenience API for tokenisation

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-29 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Added to Reitveld: http://codereview.appspot.com/2318041/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9873

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-29 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: One of Antoine's review comments made me realise I hadn't explicitly noted the why not decode with latin-1? rationale for the bytes handling. (It did come up in one or more of the myriad python-dev discussions on the topic, I just hadn't

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-29 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I think it's quite misguided. latin1 encoding and decoding is blindingly fast (on the order of 1GB/s. here). Unless you have multi-megabyte URLs, you won't notice any overhead. Ah, I didn't know that (although it makes sense now I think

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-30 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: From a function *user* perspective, the latter API (bytes-bytes, str-str) is exactly what I'm doing. Antoine's point is that there are two ways to achieve that: Option 1 (what my patch currently does): - provide bytes and str variants of all

[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-30 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Yeah, the general implementation concept I'm thinking of going with for option 2 will use a few helper functions: url, coerced_to_str = _coerce_to_str(url) if coerced_to_str: param = _force_to_str(param) # as appropriate ... return

[issue9951] introduce bytes.hex method

2010-10-02 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list mailing

[issue9951] introduce bytes.hex method

2010-10-02 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Patch generally looks good, but the type of retbuf is incorrect (should be Py_UNICODE* rather than wchar_t*). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951

[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-02 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: As per RDM's email to python-dev, a better way to create the pseudo_str values would be by decoding as ascii with a surrogate escape error handler rather than by decoding as latin-1. -- ___ Python

[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-04 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Yeah, I'll have to time it to see how much difference latin-1 vs surrogateescape makes when the MSB is set in any bytes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9873

[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On Tue, Oct 5, 2010 at 5:32 PM, STINNER Victor rep...@bugs.python.org wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: If you were worried about performance, then surrogateescape is certainly much slower than latin1

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-10-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On Wed, Oct 6, 2010 at 2:59 AM, Alexander Belopolsky rep...@bugs.python.org wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I am afraid, for ordinary scripts these modules effectively use option 3.  I think

[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-08 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I've been pondering the idea of adopting a more conservative approach here, since there are actually two issues: 1. Properly quoted URLs are transferred as pure 7-bit ASCII (due to percent-encoding of everything else). However, most

[issue10049] Add a no-op (null) context manager to contextlib

2010-10-08 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The difference here is the one pointed out in the original post: for a function, you usually only care about having a value, so if you don't want to call it, you can just swap in a None value instead. If you need an actual callable

[issue10049] Add a no-op (null) context manager to contextlib

2010-10-09 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10049 ___ ___ Python-bugs-list

[issue10049] Add a no-op (null) context manager to contextlib

2010-10-13 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: To me, this is more a matter of conceptual completeness than one of practical utility (ala fractions.Fraction). That said, I *have* personally encountered the I only sometimes want to wrap this code in a CM situation, so it isn't completely

[issue10089] Add support for arbitrary -X options

2010-10-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I suggest using sys._xoptions to make it clearer that this is for CPython specific internal implementation runtime tweaks. We're putting it in sys so *we* can get at it, not applications. (It also makes it clear that other implementations

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178 ___ ___ Python-bugs-list

[issue8202] sys.argv[0] and python -m package

2010-10-24 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8202 ___ ___ Python-bugs-list

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-10-24 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: During interpreter shutdown, modules can become unusable as module globals are set to None. This is a problem for tempfile.TemporaryDirectory, as it needs working os, os.path and stat modules in order to clean up the filesystem. The class

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Cleanup of sys and __builtin__ is already delayed - this particular issue could be fixed by delaying cleanup of a few more modules, along with the proposed change to GC invocation in issue #1545463

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Committed (with enhanced tests and a few fixes) in r85818 And credit where it's due to test___all__ for picking up a typo in my adjustment to tempfile.__all__ :) I created issue #10188 to track the shutdown problem. I'm considering taking

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178

[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Unless I hear some reasonable objections within the next week or so, I'm going to document and commit the ascii-strict coercion approach for beta 1. The difference in code clarity is such that I'm not even going to try to benchmark the two

[issue10049] Add a no-op (null) context manager to contextlib

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I find Raymond's perspective persuasive in this case. Feel free to post either the original idea or my later variant as an ASPN cookbook recipe. (you could actually combine the two, and use NullContext as an implementation detail

[issue2690] Precompute range length

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I'd still like to have another look at this before beta 1, but can't promise I'll get to it. Unassigning in case someone else has some roundtuits to spare over the next few weeks. -- assignee: ncoghlan

[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: R.I.P contextlib.nested (it is gone in 3.2 following the deprecation in 3.1). The issue is obscure enough that I don't see much value in updating the documentation for the versions that still contain it in deprecated form

[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I still think this is a good idea, I'm just not actively working on it. It might make a good project for someone wanting to get to know the process of working on CPython without having to deal with anything that is particularly tricky

[issue5178] Add context manager for temporary directory

2010-10-26 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Merging the interfaces for mkdtemp and TemporaryDirectory isn't going to happen. mkstemp/mkdtemp are for when the user wants to control the lifecycle of the filesystem entries themselves. (Note that context management on a regular file-like

[issue2001] Pydoc interactive browsing enhancement

2010-10-27 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Unassigning from ping given the lack of comments - I should be able to have a look at this in time for beta 1 -- assignee: ping - ncoghlan ___ Python tracker rep...@bugs.python.org http

[issue10220] Make generator state easier to introspect

2010-10-28 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: Generators can be in four different states that may be relevant to framework code making use of them (especially as coroutines). This state is all currently available from Python code, but is rather obscure and could be made readable

[issue10220] Make generator state easier to introspect

2010-10-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On Thu, Oct 28, 2010 at 10:55 PM, Antoine Pitrou rep...@bugs.python.org wrote: Antoine Pitrou pit...@free.fr added the comment: Is it CPython-specific? The states are not CPython-specific (they're logical states of the underlying generator

[issue10220] Make generator state easier to introspect

2010-10-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: So something like: GEN_CREATED, GEN_ACTIVE, GEN_CLOSED = range(3) def getgeneratorstate(g): Get current state of a generator-iterator. Possible states are: GEN_CREATED: Created, waiting to start execution GEN_ACTIVE: Currently

[issue10220] Make generator state easier to introspect

2010-10-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Indeed, the minimal lifecycles are: GEN_CREATED-GEN_CLOSED (exception thrown in before the generator was even started) GEN_CREATED-GEN_RUNNING-GEN_CLOSED (initial next() with internal logic that skips all yields) GEN_CREATED-GEN_RUNNING

[issue10220] Make generator state easier to introspect

2010-10-28 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10220 ___ ___ Python-bugs-list

[issue10263] python -m site does not print path details

2010-10-31 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Since it works for me (I tried both r84120, my old 2.7 build from August or so, and r86033, which is the 2.7 head), we'll need more information. The starting blurb from the interactive prompt would be a good place to start. (-m was slightly

[issue10263] python -m site does not print path details

2010-10-31 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Note also that site.py runs twice when used with -m: once implicitly during interpreter startup, and a second time as the main module. Due to the way the interpreter starts up and figures out sys.path, it is possible for the implicit import

[issue10263] python -m site does not print path details

2010-10-31 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10263 ___ ___ Python-bugs-list

[issue10263] python -m site does not print path details

2010-10-31 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: r82508 is the correct release binary (created after the error I mentioned above was fixed). I've CC'ed Ronald to see if he can shed any light - it may be a platform specific issue with the way sys.path is calculated

[issue10263] python -m site does not print path details

2010-10-31 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: No, there won't be another binary release until 2.7.1 comes out. The SVN revision number ratchets up pretty fast, since it is counting checkins on *all* branches, even experimental ones

[issue10263] python -m site does not print path details

2010-11-02 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Yeah, because the internal import system isn't fully exposed, runpy and a couple of other tools in the standard library rely on the emulation in pkgutil instead. I know there are some differences between the emulation and the builtin

[issue2001] Pydoc interactive browsing enhancement

2010-11-02 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On Wed, Nov 3, 2010 at 2:17 AM, Ron Adam rep...@bugs.python.org wrote: Ron Adam ron_a...@users.sourceforge.net added the comment: Nick, I can update the patch and move the server back into pydoc.py if that will help you get this into 3.2

[issue1500504] Alternate RFC 3986 compliant URI parsing module

2010-11-02 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I still like the higher level API concept, although I might not do it exactly as presented here any more. Independently of introducing a new parsing API, it would be worthwhile extracting the parsing tests from the attached module to make

[issue10181] get_shape0 in memoryobject.c not checked for error return

2010-11-02 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: As far as I know, PEP 3118 serves its purpose of allowing extension modules like numpy and PIL to share data without needing to copy it around all the time. It's just that memoryview wasn't really part of that purpose (since all the affected

[issue10181] get_shape0 in memoryobject.c not checked for error return

2010-11-02 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Read the Releasing the buffer section in PEP 3118 again. Unless I'm misunderstanding you completely, the rules you're asking for are already in place: those fields are entirely the responsibility of the exporting object, and it needs

[issue10263] python -m site does not print path details

2010-11-03 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Ah, yes, I see what you mean - because runpy ignores the sys.modules cache (by design), it won't see the precached module instance placed there by the bootstrap code. We actually *could* make this work on our end: if we find an existing

[issue10181] get_shape0 in memoryobject.c not checked for error return

2010-11-03 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Hmm, if we're ever creating a new copy of a Py_buffer without calling GetBuffer again on the original object, then *that* is a bug (exactly comparable to copying a PyObject pointer without incrementing the reference count - it's OK if you can

[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2010-11-03 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- title: get_shape0 in memoryobject.c not checked for error return - Problems with Py_buffer management in memoryobject.c (and elsewhere?) ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2010-11-03 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: It doesn't help that neither PEP 3118 nor the Py_buffer docs mention the obj member of the Py_buffer struct that refers back to the original object providing the buffer - that's fairly fundamental to understanding how PyBuffer_Release

[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2010-11-03 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: So the overall to-do list here is sounding like: 1. Document Py_buffer-obj appropriately in both the C API documentation and in PEP 3118 2. Ensure GetBuffer/ReleaseBuffer are used as the moral equivalent of INCREF/DECREF for Py_buffer

[issue1500504] Alternate RFC 3986 compliant URI parsing module

2010-11-03 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Just to be clear, even *I* don't think adding urischemes as it stands is a particularly great idea, and I wrote it. The only reason I haven't closed the issue is because I'd like to see it mined for additional tests in test_urlparse

[issue10318] make altinstall installs many files with incorrect shebangs

2010-11-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Removing shebang lines from svn completely and only *adding* them during installation steps as appropriate may be an interesting approach. (I noted that my grep of my local build found only correct references to python3.2 in the built scripts

[issue10318] make altinstall installs many files with incorrect shebangs

2010-11-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: For the record, my list is from an svn checkout of r86191 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10318

[issue10318] make altinstall installs many files with incorrect shebangs

2010-11-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: A few more deeper in the py3k source tree: Doc/tools/docutils/_string_template_compat.py Doc/tools/docutils/readers/python/pynodes.py Doc/tools/sphinx/pycode/pgen2/token.py Lib/lib2to3/tests/data/different_encoding.py Adding Georg, since

[issue10318] make altinstall installs many files with incorrect shebangs

2010-11-05 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: d...@python - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10318 ___ ___ Python-bugs

[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2010-11-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Reopening as a reminder to myself that I have a new PEP I want to write in this area. The idea is essentially a lighter weight alternative to PEP 377 that adds an optional __entered__ method to the context management protocol along

[issue10329] trace.py and unicode in Python 3

2010-11-05 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10329 ___ ___ Python-bugs-list

[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-11-07 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Just a note for myself when I next update the patch: the 2-tuple returned by defrag needs to be turned into a real result type of its own, and the decode/encode methods on result objects should be tested explicitly

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