Brett Cannon added the comment:
I am setting this as pending since I consider the total output acceptable, but
if Kristján has specific issues he wants to bring up or change he still can.
--
status: open -> pending
___
Python tracker
&l
Brett Cannon added the comment:
Not a problem. =)
If you want to know where an import originated from, you can probably do
something as simple as overload builtins.__import__ with a version that does a
quick stack look to see where the previous call is coming from
Brett Cannon added the comment:
I think you misunderstood what I was suggesting as a solution: there is no
conversion of module name to file name. It would simply be::
fullname.rpartition('.')[2] == os.path.splitext(os.path.split(self.path)[1])[0]
for path comparison. But hone
Brett Cannon added the comment:
I have yet to see anyone use a URL loader in serious code beyond people just
using it as an example. What I do see is lots of custom zipfile importers and
thus for the majority if people this will continue to make sense. And even with
a URL loader
Brett Cannon added the comment:
Thanks for the patch, Ronan! The fix seems fine and I will have a more thorough
look at the test later and figure out where it should go (probably only going
to worry about testing is_package() directly since that was the semantic
disconnect). I will also
Brett Cannon added the comment:
Basically pkgutil kind of handles importers properly, kind of doesn't. So if a
module defined a __loader__ it will use it, but all the rest of its code
assumes it uses only the loaders defined in pkgutil.
The problem here is that pkgutil.walk_packages()
Changes by Brett Cannon :
--
assignee: -> brett.cannon
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.or
Brett Cannon added the comment:
I should mention that Guido and others on python-dev mentioned coming up with
an API for finders/loaders that allowed for file-like API and possibly being
able to iterate over available modules when importlib's bootstrapping landed
(sorry, don't h
Brett Cannon added the comment:
Not sure what DirsOnSysPath is, but I have been only calling
importlib.invalidate_caches() as needed in order to not slow down tests
needlessly.
And as for detecting an environment change as necessary, that's essentially
impossible since it's only
Brett Cannon added the comment:
Need to update the docstrings for imp.find_module() and load_module() to
mention the functions are deprecated since there is no specific raised
deprecation, only documented deprecation.
--
___
Python tracker
<h
Brett Cannon added the comment:
Does it work in Python 3.2, John? If it does then it's just an oversight thanks
to the lack of tests in test_imp and it shouldn't be too difficult to support.
But do realize I have deprecated th
Brett Cannon added the comment:
You're right about the solution, John. I (or someone else) just needs to code
it up.
--
___
Python tracker
<http://bugs.python.org/is
Brett Cannon added the comment:
Yes, the docs should get updated and I will do that before Python 3.3 goes out
the door.
--
assignee: -> brett.cannon
___
Python tracker
<http://bugs.python.org/issu
Brett Cannon added the comment:
So the problem with the function is that had this been implemented in Python
3.2 it already would be outdated thanks to the 3.3 change of storing the file
size in the .pyc file, and simply changing the length of the sequence returned
would probably break code
Brett Cannon added the comment:
The format did change and importlib.abc.PyPycLoader was not subsequently
updated. Problem is that the ABC has been deprecated and given
backwards-compatibility instructions for Python 3.1, so I don't know if it
should be considered a priority to fix th
Brett Cannon added the comment:
I point is that it shouldn't break at all if possible, although path_stats does
potentially provide a way to deal with this (as does using keyword-only
arguments for what needs to be verified).
I'll have to think about this. One issue I have with
Brett Cannon added the comment:
Yes, a fix would be easiest, but someone has to write the fix. =) I will try to
get to it before the first beta (unless Antoine, who made the .pyc change,
wants to do it =).
--
___
Python tracker
<h
Brett Cannon added the comment:
If you look at line 127 in importlib/_bootstrap.py you will see that it is an
os.open() call to open the bytecode file for exclusive writing. I'm willing to
bet the buildbot didn't have the directory writable or something and that
triggered
Brett Cannon added the comment:
Roumen, what issue is that? Do you have an issue # you can share?
--
___
Python tracker
<http://bugs.python.org/issue14
Brett Cannon added the comment:
It's not a problem, Stefan. I just happened to have already added the
importlib.invalidate_caches() call to test_reprlib so I know that isn't the
issue.
--
___
Python tracker
<http://bugs.python.o
New submission from Brett Cannon :
If you look at http://docs.python.org/dev/py3k/library/imp.html#imp.get_tag you
will notice it has the "Changed in Python 3.3" notice for imp.lock_held() in
it, the function *below* imp.get_tag().
--
assignee: docs@python
components: Doc
New submission from Brett Cannon :
Both imp.cache_from_source() and source_from_cache() should throw
NotImplementedError when sys.implementation.cache_tag is None. See the thread
starting at http://mail.python.org/pipermail/python-dev/2012-June/120145.html
for discussion of this decision
Changes by Brett Cannon :
--
stage: -> test needed
___
Python tracker
<http://bugs.python.org/issue15056>
___
___
Python-bugs-list mailing list
Unsubscri
Brett Cannon added the comment:
Thanks for the info, Roumen. It looks like there is a single use of MAXPATHLEN
still in import.c which I hope to eliminate, so hopefully that will rectify
this problem.
--
___
Python tracker
<http://bugs.python.
Brett Cannon added the comment:
So sys.dont_write_bytecode is there to prevent bytecode writing but not
loading. This is an issue for some systems (e.g. clusters) where there are so
many processes running Python that they start to trample each others bytecode
files and it leads to malformed
Changes by Brett Cannon :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue14982>
___
___
Python-bugs-list
Brett Cannon added the comment:
We have gone this long without a lock for reload(), I don't see a reason to
start caring now.
--
resolution: -> works for me
status: open -> closed
___
Python tracker
<http://bugs.python
Changes by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Brett Cannon added the comment:
Yes, it should be tackled soon, but I lack Windows access so I can't do the
work myself. Basically no one seems to use or care about this feature so it
might die "on the vine" if someone doesn
Brett Cannon added the comment:
Sorry, been on vacation the past week.
Georg is right, nothing left is a b1 blocker, just stuff I want to get in
before 3.3 ships.
--
___
Python tracker
<http://bugs.python.org/issue13
Brett Cannon added the comment:
Thanks for the patch, Pranav. I'm probably going to be too busy for a couple of
weeks, so I won't look at this immediately, but I wanted to let you know I will
eventually get to it.
--
___
Python trac
Brett Cannon added the comment:
So co_filename is absolute in Python 3.3, but __file__ on modules is not if a
relative path is used from sys.path (as Nick pointed out). Changing this would
possibly break code as this has been baked into the import system for quite
some time. I think Nick as
Brett Cannon added the comment:
Do people feel the need to change the importlib tests to run against both the
frozen code and importlib/_bootstrap.py? If so either the test_warnings
approach (or a new one using class decorators or something) should be used to
run the tests twice
New submission from Brett Cannon :
Title says it all. This also implies updating importlib to use
sys.implementation directly.
--
components: Library (Lib)
keywords: easy
messages: 163829
nosy: brett.cannon, eric.snow
priority: deferred blocker
severity: normal
stage: needs patch
Changes by Brett Cannon :
--
dependencies: +Implement imp.get_tag() using sys.implementation
___
Python tracker
<http://bugs.python.org/issue13959>
___
___
Pytho
New submission from Brett Cannon :
Title says it all. Issue #13959 has a patch.
--
messages: 163830
nosy: brett.cannon, eric.snow
priority: normal
severity: normal
status: open
title: Re-implement imp.get_magic() in pure Python
___
Python tracker
Changes by Brett Cannon :
--
dependencies: +Re-implement imp.get_magic() in pure Python
___
Python tracker
<http://bugs.python.org/issue13959>
___
___
Python-bug
New submission from Brett Cannon :
Should also update to use unittest discovery. Might also need to update tests
to use both _frozen_importlib and importlib._bootstrap.
--
messages: 163833
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Move importlib.test to
New submission from Brett Cannon :
import.c:PyImport_ExecCodeModuleObject() is holding on to a ton of C code
thanks to get_sourcefile(). Should have PyImport_ExecCodeModuleWithPathnames()
use get_sourcefile() only. And then get_sourcefile() should get re-implemented
in Python code
Brett Cannon added the comment:
The problem of deferring to 3.4 is that it will lock in semantics which are
honestly weird and not desirable for PyImport_ExecCodeModuleObject() which is
new in 3.3.
--
___
Python tracker
<http://bugs.python.
Brett Cannon added the comment:
Why is distribute reading bytecode to begin with? What's the use case,
especially considering that using bytecode screws over other Python VMs like
Jython and IronPython.
--
___
Python tracker
Brett Cannon added the comment:
This all goes back to my original point: I don't want to promote people
shipping around bytecode only as it hampers the use of other VMs.
Anyway, I'll continue to contemplate this. Any function would have to verify
the magic number and flat-out fail
Brett Cannon added the comment:
Patch looks good, Marc. Can you sign a PSF contributor agreement and send it in
(http://www.python.org/psf/contrib/)?
--
assignee: -> brett.cannon
stage: -> commit review
___
Python tracker
<http://bugs.p
New submission from Brett Cannon :
If you look at
http://hg.python.org/cpython/file/abcd29c9a791/Lib/importlib/__init__.py you
will notice that the try/except block for seeing if _frozen_importlib exists
catches ImportError, not KeyError like it should since it is checking sys.
modules and
Brett Cannon added the comment:
The patch could be updated to ignore the 12 bytes unconditionally when reading
bytecode but still write out the accurate file size (when possible). That
should be fully compatible within Python 3.3 no matter who generated the
bytecode (PyPycLoader or import
Brett Cannon added the comment:
Changeset b7463ec1980c has the fix and test update (went with a simple solution
for the tests which uses the mock to verify). Thanks to Ronan and Marc for
helping out!
--
dependencies: -Split .pyc parsing from module loading
resolution: -> fi
Changes by Brett Cannon :
--
assignee: -> brett.cannon
resolution: -> fixed
stage: test needed -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python
Changes by Brett Cannon :
--
dependencies: +Implement imp.get_tag() using sys.implementation
___
Python tracker
<http://bugs.python.org/issue15056>
___
___
Pytho
Brett Cannon added the comment:
I ended up applying Eric's patch from #14797 and then comparing against Jeff's
patch here since Eric's cleaned up the C code. Thanks to both for the work!
--
resolution: -> fixed
stage: needs patch -> committed/rejected
s
Brett Cannon added the comment:
I meant issue #13959 for Eric's patch; wrong tab. =)
--
___
Python tracker
<http://bugs.python.org/issue15166>
___
___
Pytho
Changes by Brett Cannon :
--
resolution: -> out of date
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue2345>
___
___
Python-bugs-
Changes by Brett Cannon :
--
resolution: out of date -> wont fix
___
Python tracker
<http://bugs.python.org/issue2345>
___
___
Python-bugs-list mailing list
Un
Brett Cannon added the comment:
Is this still worth doing, Georg? Or should we make Larry do it? =)
--
nosy: +larry
___
Python tracker
<http://bugs.python.org/issue4
Changes by Brett Cannon :
--
status: pending -> closed
___
Python tracker
<http://bugs.python.org/issue11207>
___
___
Python-bugs-list mailing list
Unsubscri
Brett Cannon added the comment:
Closing since 2.7 is already out the door.
--
resolution: -> wont fix
status: open -> closed
___
Python tracker
<http://bugs.python.org/
Brett Cannon added the comment:
Never heard back from OP.
--
resolution: -> works for me
status: pending -> closed
___
Python tracker
<http://bugs.python.org/i
Brett Cannon added the comment:
Maybe you can try emailing in the form again, Marc? Let me know when you have
and if it is lost again I will bug the proper people.
Anyway, the original patch I committed added you to Misc/ACKS:
http://hg.python.org/cpython/file/56260d30985d/Misc/ACKS#l16
Brett Cannon added the comment:
Any suggestions on how to make the test work better? Otherwise I'm fine with
dropping the test since the fix has been verified at least on my machine (and
if it is broken the other VMs will notice quickly when they start to implement
t
Brett Cannon added the comment:
Thanks for the diagnosis, Stefan. Unfortunately that line is the crux of the
test. =) I will see if I can steal some time to look at the failure to see if
there is anything obvious going on.
--
___
Python tracker
Brett Cannon added the comment:
I realized the problem was that _frozen_importlib was getting set to None,
which won't trigger an exception since the code was just directly accessing
sys.modules. I switched to an ``import ... as ...`` clause and moved to
Brett Cannon added the comment:
tl;dr: "==", not "is"
Shouldn't tl;dr go first, else it seems a little pointless since I already read
the whole thing. At which point the tl;dr is really just a summary of what I
just read, not a "didn
Brett Cannon added the comment:
Probably linking the term "importers" into the glossary should be enough.
--
nosy: +brett.cannon
___
Python tracker
<http://bugs.python.o
Brett Cannon added the comment:
Patch looks fine. Next time I have python-dev time I will commit it.
--
assignee: -> brett.cannon
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/i
Brett Cannon added the comment:
Looks good to me. Go ahead and commit it.
--
assignee: brett.cannon -> pitrou
___
Python tracker
<http://bugs.python.org/issu
Changes by Brett Cannon :
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue15110>
___
___
Python-bugs-list mai
Brett Cannon added the comment:
Everything Nick said is right: PyPy did it properly according to the spec and
CPython 2.7 got it wrong. Unfortunately fixing this now would break code and so
it will simply have to stay a Python 2.7 quirk with Python 3.3 and later doing
it correctly.
So
Brett Cannon added the comment:
Re-opening so Antoine can look at Amaury's proposed fix for builtin modules.
--
status: closed -> open
___
Python tracker
<http://bugs.python.org
New submission from Brett Cannon :
I believe Barry said he was going to handle the documentation for PEP 420.
--
assignee: barry
components: Documentation
messages: 165017
nosy: barry, brett.cannon
priority: release blocker
severity: normal
stage: needs patch
status: open
title
Brett Cannon added the comment:
One request I would like to make is that while the docs are being written, to
please look at importlib.find_loader() and let me know if the name no longer
applies (it's new in Python 3.3 so it can easily be re
Brett Cannon added the comment:
So the lack of output in 3.3 is not surprising as walk_packages() won't work
with the new import implementation as it relies on a non-standard method on
loaders that import does not provide.
--
___
Python tr
Brett Cannon added the comment:
Thanks for the patch, Marc!
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Brett Cannon added the comment:
I released Pranav's patch and fleshed it out with docs, tests, and changes to
importlib's use of cache_from_source().
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<htt
Brett Cannon added the comment:
I changed to term to "loader" and linked to the glossary. I also added a
versionchanged note for Python 3.3 so people are not too surprised that pkgutil
no longer does what it did in Python 3.2.
--
resolution: -> fixed
status: o
Brett Cannon added the comment:
I went ahead and committed Eric's patch. Amaury, if you want to move the macros
to a header file I see no reason not to, but I also don't see a need so I
didn't want to spend the time doing it myself.
--
resolu
Brett Cannon added the comment:
Ronan is right that it is all about finders, not importers per-se. I fixed the
docs to not say "loader".
--
___
Python tracker
<http://bugs.python.o
Brett Cannon added the comment:
OK, finally in. Thanks for the hard work on this, Eric.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Brett Cannon added the comment:
Since the final issue is just a nicety, I am considering this issue closed.
--
dependencies: -Deprecate imp.find_module()/load_module()
resolution: -> fixed
___
Python tracker
<http://bugs.python.org/issu
Changes by Brett Cannon :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue13959>
___
___
Python-bugs-list mailing list
Unsubscri
Brett Cannon added the comment:
That "cannot import name" message seems to only come from
Python/ceval.c:import_from() which raises that exception when an AttributeError
is raised by an 'import from' statement (I think). This happens when an 'import
from'
Brett Cannon added the comment:
Ooh, first "customer" of importlib.find_loader()! Obviously if the API doesn't
work for you let me know since it's a 3.3 addition and can be tweaked to meet
your needs.
--
nosy: +brett.cannon
__
Changes by Brett Cannon :
--
assignee: -> brett.cannon
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python
Changes by Brett Cannon :
--
stage: needs patch -> patch review
___
Python tracker
<http://bugs.python.org/issue15302>
___
___
Python-bugs-list mailing list
Un
Changes by Brett Cannon :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue15328>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Brett Cannon :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue15053>
___
___
Python-bugs-list
Changes by Brett Cannon :
--
nosy: +Yury.Selivanov, larry, yselivanov
___
Python tracker
<http://bugs.python.org/issue15151>
___
___
Python-bugs-list mailin
Changes by Brett Cannon :
--
priority: normal -> release blocker
___
Python tracker
<http://bugs.python.org/issue15169>
___
___
Python-bugs-list mailing list
Un
Changes by Brett Cannon :
--
assignee: -> brett.cannon
___
Python tracker
<http://bugs.python.org/issue15169>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Brett Cannon :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue15169>
___
___
Python-bugs-list
Brett Cannon added the comment:
MAXPATHLEN no longer shows up in Python/import.c.
--
dependencies: +Clear C code under PyImport_ExecCodeModuleObject()
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.p
Changes by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<http://bugs.python.org/issue15299>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Ugh, I don't exactly love the idea of adding a method to any of importlib's
finders simply because PJE didn't try to make this non-standard API part of PEP
302 or something. But basically pkgutil is worthless without doing something
Brett Cannon added the comment:
Right, you aren't getting ImpImporters because they are only used when a module
doesn't define __loader__. But in Python 3.3, by default *all* modules get that
attribute defined.
And yes, we could either tweak pkgutil to recognize FileFinder and sp
Brett Cannon added the comment:
I might come to regret asking this, but so what? Is this actually causing you
issues, or are you literally just finding "this behavior surprising" and that's
it? I mean we could simply sort the tuples, but I don't know what kind of
perfor
Brett Cannon added the comment:
OK, so it sounds like we need to do the equivalent of sorting those tuples when
generating the bytecode. That would suggest that probably need to tweak
Python/compile.c to make it deterministic.
--
___
Python
Brett Cannon added the comment:
I disagree. They are outdated benchmarks and probably should either be removed
or left undocumented. Proper testing of performance is with the Unladen Swallow
benchmarks.
--
nosy: +brett.cannon
___
Python tracker
Brett Cannon added the comment:
The Unladen Swallow benchmarks are in no way specific to JITs; it is a set of
thorough benchmarks for measuring the overall performance of a Python VM.
As for speed.python.org, we know that it is currently not being updated as we
are waiting for people to have
Brett Cannon added the comment:
You ran the benchmarks correctly, but I was more worried about compilation time
than execution time (changing which index is for what really shouldn't make a
difference in performance, and the benchmarks show that). If you want to test
using the impo
Brett Cannon added the comment:
I think the imp functions do need to go away. They perpetuate an absolutely
horrendous API that I'm trying to slowly kill (and the underlying imp code is
already reusing importlib). They already are a burden for future API growth as
people already re
Brett Cannon added the comment:
I would have said that it wasn't because it was just the class type not picking
up on the __name__ re-assignment, but that global name failure states otherwise.
--
nosy: +brett.cannon
___
Python tracker
Brett Cannon added the comment:
RE: the API addition: fine by me if it makes your life easier.
--
___
Python tracker
<http://bugs.python.org/issue15387>
___
___
3301 - 3400 of 5934 matches
Mail list logo