[issue15403] Refactor package creation support code into a common location

2012-07-29 Thread Chris Jerdonek
Chris Jerdonek added the comment: I feel like it is already too large (it is over 1750 lines), and I did not want to create a third sibling test support module (there is also test/script_helper.py that overlaps with test.support). Do you think that the community would be open to refactoring t

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Chris Jerdonek
Chris Jerdonek added the comment: I understand that. Sorry, I meant to say "code under test." If you make no assumptions about spawning subprocesses, does this mean, for example, that the solution must satisfy the case of subprocesses invoking a different version of Python, or invoking the sa

[issue15403] Refactor package creation support code into a common location

2012-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Please let's not have something called test.supportlib in addition to test.support. If test.support grows too large we can turn it into a package. -- nosy: +pitrou ___ Python tracker

[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is an elegant solution, +1 from me. -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-lis

[issue15467] Updating __sizeof__ tests

2012-07-29 Thread Martin v . Löwis
Martin v. Löwis added the comment: I wasn't aware that test_support isn't public API. The patches are fine then; committed. -- resolution: -> fixed status: open -> closed ___ Python tracker __

[issue15487] Correct __sizeof__ support for buffered I/O

2012-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Instead of putting this in MiscIOTest, you could use the relevant class-specific test cases. -- ___ Python tracker ___

[issue15467] Updating __sizeof__ tests

2012-07-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset fa95b04e67fd by Martin v. Löwis in branch '2.7': Issue #15467: Move helpers for __sizeof__ tests into test_support. http://hg.python.org/cpython/rev/fa95b04e67fd -- ___ Python tracker

[issue15467] Updating __sizeof__ tests

2012-07-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset efade142ef01 by Martin v. Löwis in branch '3.2': Issue #15467: Move helpers for __sizeof__ tests into test_support. http://hg.python.org/cpython/rev/efade142ef01 New changeset d43ff8eb4cb3 by Martin v. Löwis in branch 'default': Issue #15467: Merge

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Ned Batchelder
Ned Batchelder added the comment: Chris: The real problem is that it isn't the "test suite" that spawns the processes, the tests invoke product code, and the product code spawns Python. So modifying the Python-spawning really means modifying the product code to do something different under c

[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-29 Thread Stefan Krah
Stefan Krah added the comment: Nick, are you talking about a complete backport or just about pulling in all functions needed by PyBuffer_ToContiguous()? -- ___ Python tracker ___

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > I'm -0.5 myself, though, for the reason that it complicates the startup > > process a little bit more, without looking very compelling. It smells > > disturbingly like LD_PRELOAD to me. > > Antoine, do you have a suggestion for how to solve the coverage.py >

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Chris Jerdonek
Chris Jerdonek added the comment: Ned, two questions: in the scenario you just described, is it a requirement that your test suite's code need not be modified (even minimally) to support coverage of subprocesses? And can the solution assume that the test suite is spawning the Python processes

[issue15451] PATH is not honored in subprocess.Popen in win32

2012-07-29 Thread Richard Oudkerk
Richard Oudkerk added the comment: > But I observe that the same script(with proper modification of file names) > works very well under Linux. After I dive into the source code, I found > Python use execvpe to invoke the child process which _will_ use the PATH > variable to search the executab

[issue15487] Correct __sizeof__ support for buffered I/O

2012-07-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch Added file: http://bugs.python.org/file26575/bufferedio_sizeof.patch ___ Python tracker ___

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- nosy: +cjerdonek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Chris Jerdonek
Chris Jerdonek added the comment: The test cases uploaded to issue 7559 ("TestLoader.loadTestsFromName swallows import errors") a while back contain a number of distinct cases (four, I think) in which an import error can be raised. IIRC, these include a couple recursive scenarios (cyclical im

[issue15403] Refactor package creation support code into a common location

2012-07-29 Thread Chris Jerdonek
Chris Jerdonek added the comment: Lib/test/test_import.py also contains test code that would benefit from this (see for example issue 15425). (Though not all files need to be refactored in a single issue.) -- ___ Python tracker

[issue15487] Correct __sizeof__ support for buffered I/O

2012-07-29 Thread Hynek Schlawack
Hynek Schlawack added the comment: There is no patch. -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Chris Jerdonek
Chris Jerdonek added the comment: The unit tests added here are another candidate for the refactoring in issue 15403 ("Refactor package creation support code into a common location"). I'll note this in that issue. -- nosy: +cjerdonek ___ Python tra

[issue15487] Correct __sizeof__ support for buffered I/O

2012-07-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Here is a patch that implements correct __sizeof__ for C implementation of buffered I/O files: io.BufferedReader, io.BufferedWriter and io.BufferedRandom. -- components: IO, Library (Lib) messages: 166756 nosy: benjamin.peterson, hynek, pitrou, stor

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Ned Batchelder
Ned Batchelder added the comment: > I'm -0.5 myself, though, for the reason that it complicates the startup > process a little bit more, without looking very compelling. It smells > disturbingly like LD_PRELOAD to me. Antoine, do you have a suggestion for how to solve the coverage.py problem? T

[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-29 Thread Christian Heimes
Christian Heimes added the comment: Thanks Stefan and Nick! I tried to find the off-by-one bug myself but gave up quickly. Stefan's rewrite is a better approach. -- ___ Python tracker

[issue15364] sysconfig confused by relative paths

2012-07-29 Thread Richard Oudkerk
Richard Oudkerk added the comment: > One example is 'srcdir': this value is only useful in the build tree and > there currently is no clean way to signal that you are retrieving a > value that is not useful. In the particular case of 'srcdir', sysconfig.is_python_build() tells you whether the

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Nothing too complicated - just noting that a test suite like ours that launches Python subprocesses to test process global state handling could fairly easily arrange to pass appropriate -C options to trigger things like recording coverage data or profiling optio

[issue12288] tkinter SimpleDialog initialvalue

2012-07-29 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- title: Python 2.7.1 tkSimpleDialog initialvalue -> tkinter SimpleDialog initialvalue ___ Python tracker ___ __

[issue6056] socket.setdefaulttimeout affecting multiprocessing Manager

2012-07-29 Thread Richard Oudkerk
Changes by Richard Oudkerk : -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed type: crash -> behavior ___ Python tracker ___ __

[issue12288] Python 2.7.1 tkSimpleDialog initialvalue

2012-07-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Add patch for py3k -- assignee: -> asvetlov keywords: +patch nosy: +asvetlov versions: +Python 3.2, Python 3.3 Added file: http://bugs.python.org/file26574/issue12288.diff ___ Python tracker

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-29 Thread Richard Oudkerk
Richard Oudkerk added the comment: > Richard, can the issue be closed? I guess so (although the change could arguably be back ported). Pickling of Exception classes is still somewhat dodgy because an example like class Error(Exception): def __init__(self, x): Exception.

[issue15295] Import machinery documentation

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Updated the statement docs to accurately describe the from X import Y case. I also noted that unlike the statement form, importlib.import_module ignores module level __import__ overrides. -- ___ Python tracker

[issue15484] CROSS: use _PYTHON_PROJECT_BASE in distutils sysconfig

2012-07-29 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15482] __import__() change between 3.2 and 3.3

2012-07-29 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: In trying to find a new case that wasn't already covered by the test suite, I found an error which I'm not even sure should be an error. Doesn't 3.2 suppress failures that occur when attempting to implicitly cache the .pyc? Anyway, given the rest of the patch, t

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I've switched back to being -1 on the PYTHONRUNFIRST idea. There are > no ACLs for environment variables, so the security implications scare > me too much for me to support the feature. I'm quite sure PYTHONHOME and PYTHONPATH already allow you to mess quite f

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Seeing as the blocker is dealt with for beta2, see #15486 for the proposed refactoring. -- ___ Python tracker ___ ___

[issue15486] Standardise the mechanisms for stripping importlib frames

2012-07-29 Thread Nick Coghlan
New submission from Nick Coghlan: Thanks to issue #15425, the number of special cases in the importlib frame stripping is growing. This patch tweaks the frame stripping mechanism to make it easy to selectively strip frames in importlib._bootstrap by creating a _call_with_frames_removed helper

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: On second thought, I realised having a general purpose "hide this" hook means that any future unconditional cases can easily be hidden just by changing from the normal call to a stripped call. I'll implement that now. --

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 75a30a478dc7 by Nick Coghlan in branch 'default': Close #15425: Eliminate more importlib related traceback noise http://hg.python.org/cpython/rev/75a30a478dc7 -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: o

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: I think the implementation I just checked in is close to being as simple as we can get: Blocks ending in _exec_module and _recursive_import are trimmed unconditionally For SyntaxError, it also trims blocks ending in get_code For ImportError, it trims everything i

[issue3871] cross and native build of python for mingw32 with packaging

2012-07-29 Thread Roumen Petrov
Roumen Petrov added the comment: May be patch 20120729 cannot be applied as my source tree contain a number of patches related to cross build - see msg166740 from issue 3754 . -- Added file: http://bugs.python.org/file26572/python-py3k-20120729-MINGW.patch

[issue3754] cross-compilation support for python build

2012-07-29 Thread Roumen Petrov
Roumen Petrov added the comment: I hope that following separate issues will address remaining part of this patch: required: - 15483: initialise include and library paths in setup.py - 15484: use _PYTHON_PROJECT_BASE in distutils sysconfig - TODO: typo in in configure.in - use ac_cv_pthread ins

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: I'll at least introduce a "_recursive_import" exit point to simplify handling of those three cases. For those, if there isn't another importlib frame on the stack below them, odds are pretty good that it has been stripped already. -- ___

[issue15483] CROSS: initialise include and library paths in setup.py

2012-07-29 Thread Roumen Petrov
Changes by Roumen Petrov : -- components: +Cross-Build versions: +Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue15484] CROSS: use _PYTHON_PROJECT_BASE in distutils sysconfig

2012-07-29 Thread Roumen Petrov
Changes by Roumen Petrov : -- components: +Cross-Build -Build type: -> compile error ___ Python tracker ___ ___ Python-bugs-list mail

[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-29 Thread Nick Coghlan
Changes by Nick Coghlan : -- title: memorview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays -> memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays ___ Python tracker

[issue15482] __import__() change between 3.2 and 3.3

2012-07-29 Thread Martin v . Löwis
Martin v. Löwis added the comment: So should 3.2 be changed to adjust the default value to match the documentation? -- nosy: +loewis ___ Python tracker ___ __

[issue15485] CROSS: append gcc library search paths

2012-07-29 Thread Roumen Petrov
New submission from Roumen Petrov: Currently if cross-build add_gcc_paths use append_dir_to_list but later prepend library paths. As result gcc is multilib 64-bit libraries will be found first before 32-bit one. -- components: Cross-Build files: 3-CROSS-append-gcc-library-search-paths

[issue15484] CROSS: use _PYTHON_PROJECT_BASE in distutils sysconfig

2012-07-29 Thread Roumen Petrov
Roumen Petrov added the comment: Also _PYTHON_PROJECT_BASE should be initialized to build directory by configure - low priority as other issue prevent python to be build and tested smoothly outside source tree. -- Added file: http://bugs.python.org/file26570/2-CROSS-set-_PYTHON_PROJEC

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, it turns out the three problem children are those which accept an "import_" callback, which is set to builtins.__import__ when accessed via the import statement. This means we end up making a *recursive* call to PyImport_ImportModuleLevelObject, which calls

[issue15484] CROSS: use _PYTHON_PROJECT_BASE in distutils sysconfig

2012-07-29 Thread Roumen Petrov
New submission from Roumen Petrov: Same as sysconfig but now in distutils _PYTHON_PROJECT_BASE has to be used in cross-build environment. -- components: Build files: 2-CROSS-use-_PYTHON_PROJECT_BASE-in-distutils-sysconfig.patch keywords: patch messages: 166734 nosy: rpetrov priority: n

[issue15483] CROSS: initialise include and library paths in setup.py

2012-07-29 Thread Roumen Petrov
New submission from Roumen Petrov: In setup.py inc_dirs and lib_dirs are not initialized in cross-build case. -- files: 1-CROSS-initialise-include-and-library-paths.patch keywords: patch messages: 166733 nosy: rpetrov priority: normal severity: normal status: open title: CROSS: initiali

[issue15268] curses configure checks fail if only /usr/include/ncursesw/curses.h is installed

2012-07-29 Thread Roumen Petrov
Roumen Petrov added the comment: Matthias, do not use hack if cross-build -- nosy: +rpetrov Added file: http://bugs.python.org/file26567/4-CROSS-avoid-ncursesw-include-path-hack.patch ___ Python tracker __

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: I realised that it is my test that was wrong in the syntax error case. Attached patch includes the test cases, and the fix for that case. The weird thing that still requires an explanation is why the chunks in the first two cases are only being partially strippe

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: OK, to investigate the failures a bit further, I turned off the traceback suppression altogether by sticking an immediate return at the start of remove_importlib_frames. For the three failing tests, this is what I got when adding a traceback.print_tb call: test

[issue15477] test_cmath failures on OS X 10.8

2012-07-29 Thread Mark Dickinson
Mark Dickinson added the comment: > These types of run-time tests based on configure-time tests are problematic > for binary installations of Python, like the OS X installers. Understood. I'm wondering how to fix this for Python, given that we're unlikely to see an OS-level fix for a while. T

[issue12834] memorview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-29 Thread Stefan Krah
Stefan Krah added the comment: Christian's posts and my initial report were about memoryview.tobytes(). It's good that you changed the title: memoryview.tobytes() is more meaningful than the slightly obscure PyBuffer_ToContiguous(). BTW, I'm sure that PyBuffer_FromContiguous() and PyObject_Copy

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I like the concept of "exit points" that Antoine introduced with a special method name. Maybe we coule generalize this and have a "execute_and_hide_frames(func, *args, **kwargs)" that is recognized by the caller in import.c. --

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file26564/issue15425_test_cases.diff ___ Python tracker ___ ___ Python-bugs-lis

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Fixed test case patch - previous one included a comment from when my test was buggy. -- Added file: http://bugs.python.org/file26565/issue15425_test_cases.diff ___ Python tracker __

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: I think tuning the "what frames to hide" heuristic is a better bet - I remember know that the real reason I stopped messing with which exceptions were thrown was that I ended up confusing pkgutil. -- ___ Python tracke

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: I actually did start refactoring a lot of this when I was working on the pkgutil changes, but stopped because that patch was already hairy enough. Maybe I should have kept going... -- ___ Python tracker

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Added patch with test cases for the situations Amaury picked up, as well another I noticed (when the from clause refers to a module that fails) -- Added file: http://bugs.python.org/file26564/issue15425_test_cases.diff ___

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: I've switched back to being -1 on the PYTHONRUNFIRST idea. There are no ACLs for environment variables, so the security implications scare me too much for me to support the feature. The simple -C option doesn't have that problem, though, and could be used as in

[issue15467] Updating __sizeof__ tests

2012-07-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file26543/sizeof_tests-2.7.patch ___ Python tracker ___ ___ Python-bugs-lis

<    1   2