[issue9527] Add aware local time support to datetime module

2012-02-21 Thread Nick Coghlan
Nick Coghlan added the comment: One important thing to remember is that once a time is in the past, whether or not DST was in effect for that time *is never going to change*. That means converting a DST aware timezone to a fixed offset timezone will work just fine for historical times. It&#

[issue2377] Replace __import__ w/ importlib.__import__

2012-02-22 Thread Nick Coghlan
Nick Coghlan added the comment: Makes sense to me (your new proposal sounds pretty close to the sketch I posted on the mailing list). It's really only the performance of in-function imports that concerned me and those are almost always going to get hits in sys.mo

[issue14019] Unify tests for str.format and string.Formatter

2012-02-22 Thread Nick Coghlan
Nick Coghlan added the comment: At least the first couple of those look like obsolete comments left over from the 2.x branch (we didn't do a mass renaming in the test suite, so many tests still live in their old locations). -- ___ Python tr

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

2012-02-24 Thread Nick Coghlan
Nick Coghlan added the comment: PEP section makes sense - I plan to mark PEP 3118 as Final once you commit this (or you can do that yourself, for that matter). -- ___ Python tracker <http://bugs.python.org/issue10

[issue14032] test_cmd_line_script prints undefined 'data' variable

2012-02-24 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: -> ncoghlan ___ Python tracker <http://bugs.python.org/issue14032> ___ ___ Python-bugs-list mailing list Unsubscri

[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-24 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: -> ncoghlan ___ Python tracker <http://bugs.python.org/issue14026> ___ ___ Python-bugs-list mailing list Unsubscri

[issue14081] Allow "maxsplit" argument to str.split() to be passed as a keyword argument

2012-02-25 Thread Nick Coghlan
Nick Coghlan added the comment: Ezio: I spotted an extraneous '[' hanging around in the updated doc signature for split, but otherwise looked fine. Éric: you're probably right, but I was sending them a note to suggest a simpler alternative, only to discover that the obvi

[issue14116] Lock.__enter__() method returns True instead of self

2012-02-25 Thread Nick Coghlan
Nick Coghlan added the comment: "with Lock() as lock:" doesn't make any sense - you need to share the lock with other threads or code for it be useful, which means you can't create it inline in the with statement header. Instead, you have to store it somewhere else (

[issue6210] Exception Chaining missing method for suppressing context

2012-02-26 Thread Nick Coghlan
Changes by Nick Coghlan : -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

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

2012-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: Aw, I guess I was too optimistic in thinking this was the last gap before we could declare it Final... +1 on creating a new feature request for NumPy style multi-dimensional indexing and slicing support on memoryview (I'm assuming that's what you m

[issue13238] Add shell command helpers to subprocess module

2012-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: For a different take on this concept: http://julialang.org/manual/running-external-programs/ -- ___ Python tracker <http://bugs.python.org/issue13

[issue1116520] Prefix search is filesystem-centric

2012-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I'm pretty sure the bootstrap mechanism needs to be able to get hold of os.py directly so it can be injected into the importlib._bootstrap namespace. However, it may be worth figuring out and documenting the bare minimum that has to exist o

[issue14131] test_threading failure on WIndows 7 3.x buildbot

2012-02-26 Thread Nick Coghlan
New submission from Nick Coghlan : http://www.python.org/dev/buildbot/all/builders/x86%20Windows7%203.x/builds/4458/steps/test/logs/stdio Appears to be new, but also isn't obviously related to any recent checkins that I noticed. (the Win7 buildbot for trunk isn't in a good place, wi

[issue14131] test_threading failure on WIndows 7 3.x buildbot

2012-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: Re: test_packaging: my mistake, the problem was actually test_package__file__ in test_imp (and Antoine already fixed it - there were some caches that weren't getting cleared properly: #14080) The last Win7 test run was green, so we may have to write thi

[issue14133] improved PEP 409 implementation

2012-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: I don't consider using Ellipsis as a sentinel value a mess. If you don't like the PEP's solution, take it up with Guido. -- ___ Python tracker <http://bugs.pyt

[issue14133] improved PEP 409 implementation

2012-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: Because you're breaking the semantics of the "raise X from Y" syntax. That syntax is *just* syntactic sugar for "_exc = X; _exc.__cause__ = Y; raise _exc". Under PEP 409, that remains true. Your patch breaks it. If you want to change

[issue14133] improved PEP 409 implementation

2012-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: The other problem with the "separate attribute" approach is that it makes the condition for suppressing the context ugly: exc.__suppress_context__ or exc.__cause__ is not None That's hardly cleaner than: exc.__cause__

[issue14133] improved PEP 409 implementation

2012-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: Regardless, I'm rejecting this for not complying with the PEP specification (which is quite explicit about the implementation mechanism and the API exposed to Python). If you want to challenge an approved PEP, the correct way to go about it is to write

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-26 Thread Nick Coghlan
New submission from Nick Coghlan : I stuffed up the review on one of the new tests in the PEP 409 patch - the one that checks if the exception context is suppressed correctly from the command line. That test should be drastically simplified and moved from test_raise to test_cmd_line_script

[issue14133] improved PEP 409 implementation

2012-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: The alternatives are a backwards compatibility break (i.e. raise exc from other_exc would suppress the context, but exc.__cause__ = other_exc would not) or else that we don't succeed in eliminating the dual use of __cause__ in the display routines. Given

[issue14133] improved PEP 409 implementation

2012-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: Also, ensuring class invariants by setting derived attributes correctly is one of the primary use cases for properties, so objecting to my proposed approach is objecting to a fairly fundamental programming technique

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Nick Coghlan
Nick Coghlan added the comment: It's about separating out the testing of the command line executable (i.e. test_cmd_line and test_cmd_line_script) from that of the interpreter's internal behaviour. test_raise is about making sure the "raise" statement works correctly -

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Nick Coghlan
Nick Coghlan added the comment: test_cmd_line and test_cmd_line_script are both about testing the behaviour of the interpreter when run from the command line. Since this test *is* a behavioural test for the interpreter when invoked as an application, it should be in one of them. The former

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Nick Coghlan
Nick Coghlan added the comment: Hah, I've been dealing with Python's regression test suite for 8+ years and there are still cases where I don't understand the rationale for testing things a particular way (beyond "it must have seemed like a good idea at the time&q

[issue13968] Support recursive globs

2012-02-29 Thread Nick Coghlan
Nick Coghlan added the comment: FWIW, I've also come around to the point of view that it's worthwhile to provide stdlib support for the "**" convention (specifically due to the UI aspect that Michael mentions). -- ___ P

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

2012-02-29 Thread Nick Coghlan
Nick Coghlan added the comment: For 3.2, there's no removal to document - we asked MvL to drop the buffer APIs from PEP 384, so they've never been part of the stable ABI. >From the PEP: "The buffer interface (type Py_buffer, type slots bf_getbuffer >and bf_release

[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2012-03-01 Thread Nick Coghlan
Nick Coghlan added the comment: Consider a Python wrapper around a bytes object, or mmap or similar that wants to pass PEP 3118 buffer requests through to the underlying object. Currently, there's no way to write such a delegation - the delegating class has to be written

[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2012-03-01 Thread Nick Coghlan
Nick Coghlan added the comment: To answer your other question, no, strview isn't related - that's strictly a PEP 3118 *consumer*, which is well supported from the Python side now that memoryview is fixed. The trick will be to allow a Python implemented object to be a PEP 3118

[issue1346572] Remove inconsistent behavior between import and zipimport

2012-03-01 Thread Nick Coghlan
Nick Coghlan added the comment: Does "compileall" generate both .pyc and .pyo by default? Or do you have to run it twice? If the latter, does pysetup handle that for you? MvL is correct that zipimport should ignore .pyo files when __debug__ is set and vice-versa, but the precompila

[issue1346572] Remove inconsistent behavior between import and zipimport

2012-03-01 Thread Nick Coghlan
Nick Coghlan added the comment: Status quo sounds fine then. +1 for closing it again. -- ___ Python tracker <http://bugs.python.org/issue1346572> ___ ___ Pytho

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

2012-03-02 Thread Nick Coghlan
Nick Coghlan added the comment: It occurs to me that one thing that *could* be backported to early versions are some of the documentation improvements on how to correctly handle the lifecycle of fields in Py_buffer. That gets messy though because memoryview doesn't behave nicely in

[issue2377] Replace __import__ w/ importlib.__import__

2012-03-04 Thread Nick Coghlan
Nick Coghlan added the comment: Yes, the import related C API should be turned into a mere wrapper around the appropriate importlib code wherever possible. I don't think that needs to be a gating criteria for the initial commit, t

[issue14208] No way to recover original argv with python -m

2012-03-06 Thread Nick Coghlan
Nick Coghlan added the comment: This is closely related to PEP 395, since multiprocessing currently hits the same issue in trying to figure out the correct setting for sys.argv0. I quite like the sys.__argv__ idea for preserving the *exact* underlying command line (Alex Gaynor was recently

[issue14208] No way to recover original argv with python -m

2012-03-07 Thread Nick Coghlan
Nick Coghlan added the comment: In framing a question for Raymond regarding his preference for avoiding the __argv__ name, I realised I agreed with him. My reasoning is that, when a Python process starts, sys.stdin is sys.__stdin__, sys.stdout is sys.__stdout__ and sys.stderr is sys

[issue14220] "yield from" kills generator on re-entry

2012-03-07 Thread Nick Coghlan
Nick Coghlan added the comment: Added Mark Shannon to the nosy list - he's been tinkering with this area of the interpreter lately. This definitely needs to be fixed though (even if that does mean major surgery on the implementation, up to and including the introduction of an __iter_f

[issue14209] pkgutil.iter_zipimport_modules ignores the prefix parameter for packages

2012-03-07 Thread Nick Coghlan
Nick Coghlan added the comment: Adding Brett, since the plan is to clear out a lot of the redundant code in pkgutil once importlib is fully bootstrapped as the standard import implementation. (although this will still affect the older versions directly) -- nosy: +brett.cannon

[issue14127] os.stat and os.utime: allow preserving exact metadata

2012-03-07 Thread Nick Coghlan
Nick Coghlan added the comment: FWIW, +1 on using the *name* of the keyword arg to define the format/resolution of the argument. It's simple and clear right now, and is easily updated to handle higher resolutions in the future. -- nosy: +nco

[issue14243] NamedTemporaryFile unusable under Windows

2012-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: What's the proposal here? If delete is True, close() must delete the file. It is not acceptable for close() and __del__() to behave differently. OTOH, if the proposal is merely to change the way the file is opened on Windows so that it can be opened

[issue14243] NamedTemporaryFile unusable under Windows

2012-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: The whole point of close() methods is to offer deterministic resource management to applications that need it. Pointing out to applications when they're relying on CPython's refcounting for prompt resource cleanup is why many of the standard types n

[issue14243] NamedTemporaryFile unusable under Windows

2012-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: Dave, decoupling the lifecycle of the created file from the object that created it is exactly what delete=False already covers. The complicated dance in NamedTemporaryFile is only to make *__del__* work a bit more reliably during process shutdown (due to some

[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-11 Thread Nick Coghlan
Nick Coghlan added the comment: Mark's patch looks good on a quick read through (although I still need to double check where f_lasti gets incremented to be happy the new comment about YIELD_FROM is accurate). If someone gets to this soon, great, otherwise I'll deal with it afte

[issue14133] improved PEP 409 implementation

2012-03-11 Thread Nick Coghlan
Nick Coghlan added the comment: Reviewed - actual impl looks good to me, couple of comments regarding the docs and tests. -- ___ Python tracker <http://bugs.python.org/issue14

[issue14133] improved PEP 409 implementation

2012-03-16 Thread Nick Coghlan
Nick Coghlan added the comment: With the decision on whether or not to suppress the context moved out to a separate flag, I think we need to allow it. Requiring that the flag be False *and* that the context also be None gets us back to asking the question of why the flag doesn't work

[issue14034] Add argparse howto

2012-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: 13850 (already mentioned above) is my relevant argparse docs proposal - it turns out the other argparse issues I remembered posting were actual feature requests rather than docs suggestions (FWIW, those are 14037 and 14039

[issue14034] Add argparse howto

2012-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: A couple of thoughts on the draft HOWTO: I like the "verbosity" example, but I'd also like to see it continue on into introducing the "action='count'" alternative that allows "-vv" to set the verbosity level to 2

[issue14034] Add argparse howto

2012-03-19 Thread Nick Coghlan
Nick Coghlan added the comment: Rather than "is recommended by at least one core CPython developer" I'd say "matches the way the CPython executable handles its own verbosity argument" (check the output of "python --help") Also, a better fix for the no

[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2012-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: The reason I don't particularly like the "delegation only" API is that the combination of the new memoryview implementation and bytes/mmap/etc to get a flat region of memory to play with means you could do some quite interesting things entirel

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-03-27 Thread Nick Coghlan
Nick Coghlan added the comment: Yup, I plan to get a few things like this incorporated once I have broadband access at home again. Probably won't be early enough to get things into alpha 2, but they should make it for alpha 3. -- ___ P

[issue14432] Bug in generator if the generator in created in a C thread

2012-03-28 Thread Nick Coghlan
Nick Coghlan added the comment: The proposed fix sounds reasonable to me. Would it be possible to work something into test_capi to actually test it? -- nosy: +ncoghlan ___ Python tracker <http://bugs.python.org/issue14

[issue14432] Bug in generator if the generator in created in a C thread

2012-03-28 Thread Nick Coghlan
Nick Coghlan added the comment: It may not even have to specifically test the crash - any operation that accessed the tstate on the frame and could be shown to be accessing the wrong thread state when called from another thread could demonstrate the problem

[issue14439] RunModule(): display the traceback on failure

2012-03-29 Thread Nick Coghlan
Nick Coghlan added the comment: Huh? Demonstration please, as the -m switch absolutely does display tracebacks when the call fails: $ python -m timeit -s "raise RuntimeError" Traceback (most recent call last): File "/usr/lib64/python2.7/timeit.py", line 298, in main

[issue14439] RunModule(): display the traceback on failure

2012-03-29 Thread Nick Coghlan
Nick Coghlan added the comment: Never mind, I just looked at your patch and better understand what you're wanting to improve (i.e. diagnosing problems with bootstrapping runpy itself, not the errors that occur after runpy has already been found). However, your proposed soluti

[issue14439] Easier error diagnosis when bootstrapping the runpy module in main

2012-03-29 Thread Nick Coghlan
Changes by Nick Coghlan : -- title: RunModule(): display the traceback on failure -> Easier error diagnosis when bootstrapping the runpy module in main ___ Python tracker <http://bugs.python.org/issu

[issue14439] Easier error diagnosis when bootstrapping the runpy module in main

2012-03-29 Thread Nick Coghlan
Nick Coghlan added the comment: Taking a closer look at the four affected cases, I've changed my mind - the patch looks reasonable, go ahead and add it (as the new output actually still makes sense in the RunMainFromImporter case) However, additional test cases should be add

[issue14417] dict RuntimeError workaround

2012-03-31 Thread Nick Coghlan
Nick Coghlan added the comment: Attached script is a first cut at a multi-threading stress test for the new dict behaviour. It should be significantly worse than anything a real world app is likely to be doing to a dictionary that is shared between threads without any form of synchronisation

[issue13238] Add shell command helpers to subprocess module

2012-03-31 Thread Nick Coghlan
Nick Coghlan added the comment: Bumping the target version for this issue to 3.4. There's a lot of active development in the shell convenience function space at the moment, including my shell_command, Vinay Sajip's sarge, Kenneth Reitz's envoy and the possibility of doing som

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-03-31 Thread Nick Coghlan
Nick Coghlan added the comment: For the record, my shell access convenience API proposal is in issue 13238. I'm not going to push that for 3.3 though - convenient shell access from Python is currently an area with a lot of active third party development, so I think it's worthwhile

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-01 Thread Nick Coghlan
Nick Coghlan added the comment: Everyone missed my other argument in favour of alternate constructor methods: fixing the currently wrong default arguments. There is no good reason to break working code when beginner confusion can be better addressed by telling them to avoid calling the Popen

[issue14417] dict RuntimeError workaround

2012-04-01 Thread Nick Coghlan
Nick Coghlan added the comment: A thought prompted by Raymond's comment: did we ever try just protecting the retry as a recursive call? If we can stop the stack blowing up, it seems to me we'd get the best of both worlds (that is, crashes become RuntimeError, but naive multi-thread

[issue13585] Add contextlib.CallbackStack

2012-04-02 Thread Nick Coghlan
Nick Coghlan added the comment: I'm unlikely to add the contextlib2.ContextStack API as written. I aim to have an updated variant (called contextlib.CallbackStack) available for alpha 3 in May: https://bitbucket.org/ncoghlan/contextlib2/issue/8/rename-contextstack-to-callbackstac

[issue14486] Add some versionchanged notes in threading docs

2012-04-03 Thread Nick Coghlan
New submission from Nick Coghlan : A (very) minor irritation discovered today - the PEP 8 style names were added to the threading.Thread API in 2.6, but the only notice of this is up at the top of the module docs. Some embedded notices like: ..versionchanged:: 2.6 Added PEP 8

[issue14487] Add pending() query method to Queue.Queue

2012-04-03 Thread Nick Coghlan
New submission from Nick Coghlan : The task management API in the Queue module doesn't let you check to see if there are any pending tasks still being processed. A pending() query API (analagous to empty() and full()) would resolve that problem. The use case is for a process that termi

[issue14487] Add pending() query method to Queue.Queue

2012-04-03 Thread Nick Coghlan
Changes by Nick Coghlan : -- components: +Library (Lib) stage: -> needs patch type: -> enhancement versions: +Python 3.3 ___ Python tracker <http://bugs.python.org/i

[issue9634] Add timeout parameter to Queue.join()

2012-04-03 Thread Nick Coghlan
Nick Coghlan added the comment: I just created #14487 to request a documented API (Queue.pending()) that provides a formal mechanism for asking whether or not any jobs are still pending (analagous to the existing empty() and full() query methods). Specifically, what I have is a client

[issue14487] Add pending() query method to Queue.Queue

2012-04-03 Thread Nick Coghlan
Changes by Nick Coghlan : -- resolution: -> duplicate status: open -> closed superseder: -> Add timeout parameter to Queue.join() ___ Python tracker <http://bugs.python.or

[issue9634] Add timeout parameter to Queue.join()

2012-04-03 Thread Nick Coghlan
Nick Coghlan added the comment: I killed off my new issue in favour of this one, since they're covering the same ground. -- versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/i

[issue9634] Add timeout parameter to Queue.join()

2012-04-03 Thread Nick Coghlan
Nick Coghlan added the comment: The function below is the workaround I plan to use based on the undocumented-but-public Thread attributes that relate to the task queue (it's essentially just a combination of Queue.join() with the existing structure of the Queue.get() implementation):

[issue9634] Add timeout parameter to Queue.join()

2012-04-03 Thread Nick Coghlan
Nick Coghlan added the comment: The thread pool impl where I'm using this: http://git.fedorahosted.org/git/?p=pulpdist.git;a=blob;f=src/pulpdist/cli/thread_pool.py -- ___ Python tracker <http://bugs.python.org/i

[issue9634] Add timeout parameter to Queue.join()

2012-04-04 Thread Nick Coghlan
Nick Coghlan added the comment: I probably will eventually - I'll be playing catchup a bit on other tasks this month after doing almost no coding for CPython since some time in Feb. -- ___ Python tracker <http://bugs.python.org/i

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2012-04-09 Thread Nick Coghlan
Nick Coghlan added the comment: I agree we need to add something here to better support the idiom where the "close" and "delete" operations on a NamedTemporaryFile are decoupled without the delete becoming a completely independent call to os.unlink(). I agree with RDM

[issue14514] Equivalent to tempfile.NamedTemporaryFile that deletes file at context exit

2012-04-09 Thread Nick Coghlan
Nick Coghlan added the comment: I converted issue #14243 to a feature request, so this is now a duplicate. -- nosy: +ncoghlan resolution: -> duplicate status: open -> closed superseder: -> tempfile.NamedTemporaryFile not particularly useful o

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2012-04-09 Thread Nick Coghlan
Nick Coghlan added the comment: Although, for the stdlib version, I wouldn't suppress the OS Error (I'd follow what we currently do for TemporaryDirectory) -- ___ Python tracker <http://bugs.python.o

[issue14512] Pydocs module docs server not working on Windows.

2012-04-09 Thread Nick Coghlan
Nick Coghlan added the comment: Hmm, we changed a few things with the way the back end server for pydoc works in 3.2. I didn't realise there was a Windows shortcut though, and I don't know how it gets generated. It sounds like it is still using the "-g" option, which is

[issue14544] Limit "global" keyword name conflicts in language spec to those enforced by CPython

2012-04-10 Thread Nick Coghlan
New submission from Nick Coghlan : The language spec currently includes the following paragraph [1]: Names listed in a global statement must not be defined as formal parameters or in a for loop control target, class definition, function definition, or import statement. While the first

[issue14544] Limit "global" keyword name conflicts in language spec to those enforced by CPython

2012-04-10 Thread Nick Coghlan
Nick Coghlan added the comment: Thread link: http://mail.python.org/pipermail/python-ideas/2012-April/014783.html -- ___ Python tracker <http://bugs.python.org/issue14

[issue14547] Python symlink to script behaves unexpectedly

2012-04-11 Thread Nick Coghlan
Nick Coghlan added the comment: Specifically, we end up calling os.realpath() (or the C level equivalent) when initialising __main__.__file__ and sys.path[0]. Agreed this behaviour should be documented (and tested!) explicitly. -- assignee: -> docs@python components: +Documentat

[issue14515] tempfile.TemporaryDirectory documented as returning object but returns name

2012-04-11 Thread Nick Coghlan
Nick Coghlan added the comment: Change looks fine to me - go ahead and commit it :) -- ___ Python tracker <http://bugs.python.org/issue14515> ___ ___ Python-bug

[issue14570] Document json "sort_keys" parameter properly

2012-04-12 Thread Nick Coghlan
New submission from Nick Coghlan : The json "sort_keys" parameter is actually supported as an argument to dump() and dumps() (and is used that way in the examples), but is only documented as an argument to the JSONEncoder constructor. -- assignee: docs@python components: Doc

[issue14577] pickling uses __class__ so you can't pickle proxy/mock objects that pretend to be other objects

2012-04-14 Thread Nick Coghlan
Nick Coghlan added the comment: Some additional thoughts for anyone else that comes across this issue. Consider the case of a weakref proxy (the only proxy type in the stdlib): for that, you never want to serialise the proxy, you want to serialise the original object. To correctly serialise

[issue36797] Cull more oudated distutils information

2019-05-21 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +13372 ___ Python tracker <https://bugs.python.org/issue36797> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36797] Cull more oudated distutils information

2019-05-21 Thread Nick Coghlan
Nick Coghlan added the comment: While I do have a second PR open with some additional smaller cleanups, the first PR removed the outdated information that seemed most problematic. -- resolution: -> fixed stage: patch review -> resolved status: open -&g

[issue33071] Document that PyPI no longer requires 'register'

2019-05-21 Thread Nick Coghlan
Nick Coghlan added the comment: This has been merged for 3.8 and 3.7, but not for 2.7, since the docs have diverged far enough that the automatic backport didn't work: https://github.com/python/cpython/pull/13087#issuecomment-494402704 Given the proximity to the general end of life o

[issue36751] Changes in the inspect module for PEP 570

2019-05-22 Thread Nick Coghlan
Nick Coghlan added the comment: I split https://bugs.python.org/issue37010 out as a separate performance issue in case anyone is inclined to explore the idea of reversing the relationship between inspect.signature and inspect.getfullargspec, such that the latter becomes a fast building

[issue37010] Review performance of inspect.getfullargspec

2019-05-22 Thread Nick Coghlan
New submission from Nick Coghlan : (Splitting out a separate performance issue from https://bugs.python.org/issue36751#msg342683) There can be two quite different reasons for inspecting a function signature: * inspecting arbitrary functions to learn as much about them as possible in order

[issue36797] Cull more oudated distutils information

2019-05-23 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset e788057a9188ff37e232729815dfda2529079420 by Nick Coghlan in branch 'master': bpo-36797: Reduce levels of indirection in outdated distutils docs (#13462) https://github.com/python/cpython/commit/e788057a9188ff37e232729815dfda

[issue37107] ensurepip --upgrade doesn't change the version of pip used by venv

2019-06-08 Thread Nick Coghlan
Nick Coghlan added the comment: (Added packaging, Linux distro, and Windows and macOS installer folks to the cc list) Chris and I were discussing this behaviour, and it turns out even I had forgotten how we had specified this feature in PEP 453: `ensurepip --upgrade` ensures that an older

[issue37107] ensurepip --upgrade doesn't change the version of pip used by venv

2019-06-08 Thread Nick Coghlan
Nick Coghlan added the comment: Addressing the other part of Chris's initial post: there's also no `--upgrade-pip` option on `venv` itself. Instead, there's only an `--upgrade` option that is intended for *Python* version upgrades, and restructures the internal layout of the

[issue34836] test_ssl.test_default_ecdh_curve needs no tls1.3 flag in 2.7, for now

2019-06-08 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 99b5c940d3471e0ed6579771d94e7342d7c733e0 by Nick Coghlan (Dimitri John Ledkov) in branch '2.7': [2.7] bpo-34836: fix test_default_ecdh_curve, needs no tlsv1.3. (GH-9626) https://github.com/python/cpyt

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-10 Thread Nick Coghlan
New submission from Nick Coghlan : The Porting section of the What's New guide is for changes where the old behaviour was at best arguably correct, but it's still possible someone was relying on it behaving exactly the way it used to. It isn't for us to say "We broke all

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-11 Thread Nick Coghlan
Nick Coghlan added the comment: The key problem isn't Cython itself, the problem is that Cython generated libraries can't be rebuilt for 3.8 without regenerating their C files. I'd be fine with PyCode_NewWithPosArgs (Victor's right that a descriptive naming convention ha

[issue28009] core logic of uuid.getnode() needs refresh

2019-06-15 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 3a1d50e7e573efb577714146bed5c03b9c95f466 by Nick Coghlan (Michael Felt) in branch 'master': bpo-28009: Fix uuid SkipUnless logic to be based on platform programs capable of introspection (GH-12777) https://github.com/python/cpyt

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

2019-06-18 Thread Nick Coghlan
Nick Coghlan added the comment: (Note: this isn't SC feedback yet, it's individual contributor feedback from me) As others noted, the reason we treat "Incompatible with Cython generated source code" distinctly from other C API source compatibility issues is because C

[issue20443] __code__. co_filename should always be an absolute path

2019-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: Perhaps `os._abspath_for_import`? If importlib finds it, then it can handle making early paths absolute itself, otherwise it will defer doing that until it has the full external import system bootstrapped. (importlib does try to make all paths absolute as it

[issue36210] correct AIX logic in setup.py for (non-existant) optional extensions

2019-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 08970cb03c61f62f4f69e7769d0075fa66bb86aa by Nick Coghlan (Michael Felt) in branch 'master': bpo-36210: update optional extension handling for AIX (GH-12202) https://github.com/python/cpython/commit/08970cb03c61f62f4f69e7769d0075

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

2019-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: It isn't the actively maintained projects that publish wheel files that I'm worried about fixing - it's the sdist only projects that would otherwise only need recompilation to work on the new Python version. With this fixed, and the PyCode_Ne

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: I'm happy with the change in https://github.com/python/cpython/pull/13959, but we need sign-off from Łukasz as release manager on bumping the Py_VERSION_SERIAL a bit early so Cython can reliably detect that this change has been reverted without having to

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

2019-06-24 Thread Nick Coghlan
Nick Coghlan added the comment: There's also the question of complying with our own deprecation policy, as the approval to ditch tp_print API compatibility in PEP 590 relied on the fact that it has been deprecated since Python 3.0. However, it turns out the associated program

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-24 Thread Nick Coghlan
Nick Coghlan added the comment: In reviewing https://github.com/cython/cython/pull/3009, Jeroen pointed out that my symbol checking idea wouldn't actually work, since the preprocessor can only see preprocessor definitions, not compiler symbols. If we're going to rely on a pr

[issue37438] ConfigParser.set() docs should mention allow_no_value

2019-06-28 Thread Nick Coghlan
New submission from Nick Coghlan : Reviewing some code today, I came across a ConfigParser.set() call that only specified the section and key, with the value argument missing. If you look at the ConfigParser.set() docs, this seems like incorrect code, as those docs indicate that the value

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

2019-07-01 Thread Nick Coghlan
Change by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> compile error ___ Python tracker <https://bugs.python

<    11   12   13   14   15   16   17   18   19   20   >