Georg Brandl added the comment:
Richard, can the issue be closed?
--
priority: release blocker - critical
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1692335
___
Nick Coghlan added the comment:
General comment:
runpy, pkgutil, et al should all get See Also links at the top pointing to
the new import system section.
Import system intro:
As noted above, I suggest changing the name :)
Opening section should refer to importlib.import_module(). Any
Nick Coghlan added the comment:
Great start here Barry, I'll switch my checkout over to read/write access and
start contributing fixes.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15295
Nick Coghlan added the comment:
Pushed the import machinery - import system change (which hopefully won't
break Barry's world)
Also merged in a more recent version of trunk. This probably screwed up the
default branch in this clone, but the clone should be done after these docs
updates.
Serhiy Storchaka added the comment:
Patches updated. Simplified struct __sizeof__ testing for 2.7 and 3.2 and fixed
(using 'n' for Py_ssize_t) for 3.3.
--
nosy: +meador.inge
Added file: http://bugs.python.org/file26561/sizeof_tests-3.3_2.patch
___
Changes by Serhiy Storchaka storch...@gmail.com:
Added file: http://bugs.python.org/file26562/sizeof_tests-3.2_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15467
___
Changes by Serhiy Storchaka storch...@gmail.com:
Added file: http://bugs.python.org/file26563/sizeof_tests-2.7_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15467
___
Changes by Serhiy Storchaka storch...@gmail.com:
Removed file: http://bugs.python.org/file26541/sizeof_tests-3.3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15467
___
Changes by Serhiy Storchaka storch...@gmail.com:
Removed file: http://bugs.python.org/file26542/sizeof_tests-3.2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15467
___
Changes by Serhiy Storchaka storch...@gmail.com:
Removed file: http://bugs.python.org/file26543/sizeof_tests-2.7.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15467
___
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
Changes by Nick Coghlan ncogh...@gmail.com:
--
nosy: +ncoghlan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
___
Python-bugs-list
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
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
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 tracker
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 rep...@bugs.python.org
Changes by Nick Coghlan ncogh...@gmail.com:
Removed file: http://bugs.python.org/file26564/issue15425_test_cases.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
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.
--
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
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.
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:
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
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 rep...@bugs.python.org
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:
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:
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
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:
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:
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 rep...@bugs.python.org
http://bugs.python.org/issue15482
___
Changes by Nick Coghlan ncogh...@gmail.com:
--
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
Changes by Roumen Petrov bugtr...@roumenpetrov.info:
--
components: +Cross-Build -Build
type: - compile error
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15484
___
Changes by Roumen Petrov bugtr...@roumenpetrov.info:
--
components: +Cross-Build
versions: +Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15483
___
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.
--
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
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
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
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:
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.
--
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
Nick Coghlan added the comment:
Seeing as the blocker is dealt with for beta2, see #15486 for the proposed
refactoring.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
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
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,
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15482
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15425
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15484
___
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
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):
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 rep...@bugs.python.org
Changes by Richard Oudkerk shibt...@gmail.com:
--
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
type: crash - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6056
Changes by Andrew Svetlov andrew.svet...@gmail.com:
--
title: Python 2.7.1 tkSimpleDialog initialvalue - tkinter SimpleDialog
initialvalue
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12288
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
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
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 rep...@bugs.python.org
http://bugs.python.org/issue12834
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? To
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,
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
Hynek Schlawack added the comment:
There is no patch.
--
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15487
___
___
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
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
Changes by Chris Jerdonek chris.jerdo...@gmail.com:
--
nosy: +cjerdonek
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14803
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
keywords: +patch
Added file: http://bugs.python.org/file26575/bufferedio_sizeof.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15487
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 executable.
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
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
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 rep...@bugs.python.org
http://bugs.python.org/issue12834
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
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
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
Antoine Pitrou added the comment:
Instead of putting this in MiscIOTest, you could use the relevant
class-specific test cases.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15487
___
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 rep...@bugs.python.org
http://bugs.python.org/issue15467
Antoine Pitrou added the comment:
This is an elegant solution, +1 from me.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
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 rep...@bugs.python.org
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
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
Antoine Pitrou 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
Cheer Xiao added the comment:
There is a bigger problem:
class C:
... class D:
... pass
...
repr(C)
class '__main__.C'
repr(C.D)
class '__main__.D'
Default repr on nested classes produce specious results.
The problem become pratical when you have two nested classes C1.D and
Chris Jerdonek added the comment:
At this point, would you advise me to add even more to the existing hodge
podge, or to create a third sibling test support module? My patch adds closely
related test support functionality.
Incidentally, this discussion relates to the point I was getting at
Atsuo Ishimoto added the comment:
+1 for keeping the file name unchanged. This solution is not very
compatible with prior versions, but simple and least-surprise.
I prefer other platforms than Windows to use same method to build OSError.
--
___
Antoine Pitrou added the comment:
I don't mind refactoring test support routines in maintenance release. I
said it was too late for 3.3 because the beta period is closing; but it
could be fine for 3.3.1 ;)
As for the way forward, I see three possibilites:
1) put everying in test.support, as a
Changes by Meador Inge mead...@gmail.com:
--
stage: - committed/rejected
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15467
___
Ned Batchelder added the comment:
Chris, I'm not sure how to answer your questions. The more powerful and
flexible, the better. There is no must here. I'm looking for a way to avoid
the hacks coverage.py has used in the past to measure coverage in subprocesses.
A language feature that
Serhiy Storchaka added the comment:
Patches updated on Meador's remarks. Tests updated to use new test.support
helpers.
--
Added file: http://bugs.python.org/file26576/itertools_sizeof-3.3-2.patch
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
Added file: http://bugs.python.org/file26577/itertools_sizeof-3.2-2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15475
___
Changes by Serhiy Storchaka storch...@gmail.com:
Added file: http://bugs.python.org/file26578/itertools_sizeof-2.7-2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15475
___
Serhiy Storchaka added the comment:
Sorry, on Martin's remarks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15475
___
___
Python-bugs-list
Martin v. Löwis added the comment:
rhettinger: users frequently need sys.getsizeof. See, for example,
http://stackoverflow.com/questions/1331471/in-memory-size-of-python-stucture
http://stackoverflow.com/questions/449560/how-do-i-determine-the-size-of-an-object-in-python
Meador Inge added the comment:
Serhiy, I didn't analyze it too in depth, but why aren't the test cases using
the __sizeof__ support work you implemented for issue15467? I think these
tests should be using the more exact method like your other '__sizeof__'
patches.
--
nosy:
Serhiy Storchaka added the comment:
Instead of putting this in MiscIOTest, you could use the relevant
class-specific test cases.
Thank you, good advice. Here is updated patch.
--
Added file: http://bugs.python.org/file26579/bufferedio_sizeof-2.patch
Changes by Meador Inge mead...@gmail.com:
--
nosy: +meador.inge
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list
Chris Jerdonek added the comment:
Okay, then in the interest of understanding why various alternatives fail, I'll
just throw out the suggestion or question that I had in mind because I don't
see it mentioned above or on the web page.
Why wouldn't it work to define an alias or script that
Serhiy Storchaka added the comment:
Serhiy, I didn't analyze it too in depth, but why aren't the test cases
using the __sizeof__ support work you implemented for issue15467? I think
these tests should be using the more exact method like your other
'__sizeof__' patches.
Because struct has
Chris Jerdonek added the comment:
Thanks for your thoughts. For the purposes of this patch, I will change to
putting the new support functionality in test.support. Going forward, if we
could do some of the refactoring for 3.3.1, that would be great. :)
I worry that the third option may make
Antoine Pitrou added the comment:
Are you opposed to (2), or is it simply less favorable?
Less favorable, because it produces longer import strings
(test.support.some_helper instead of test.some_helper).
--
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
sys.getsizeof is certainly CPython-specific. However, __sizeof__ is not
just an implementation detail of sys.getsizeof, just as __len__ is not an
implementation detail of len(). Authors of extension types are supposed to
implement it if object.__sizeof__
Chris Jerdonek added the comment:
Less favorable, because it produces longer import strings
(test.support.some_helper instead of test.some_helper).
This can be addressed by exposing the API in __init__.py though (as does, say,
the unittest package), no?
--
Georg Brandl added the comment:
Please reopen if you think it should be backported.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1692335
___
Roundup Robot added the comment:
New changeset 8a02a93c803a by Antoine Pitrou in branch '3.2':
Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.
http://hg.python.org/cpython/rev/8a02a93c803a
New changeset 1d811e1097ed by Antoine Pitrou in branch 'default':
Issue #15487:
Antoine Pitrou added the comment:
Le dimanche 29 juillet 2012 à 17:00 +, Chris Jerdonek a écrit :
Chris Jerdonek added the comment:
Less favorable, because it produces longer import strings
(test.support.some_helper instead of test.some_helper).
This can be addressed by exposing the
Roundup Robot added the comment:
New changeset 1102e86b8739 by Antoine Pitrou in branch '2.7':
Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.
http://hg.python.org/cpython/rev/1102e86b8739
--
___
Python tracker
1 - 100 of 174 matches
Mail list logo