Brett Cannon added the comment:
While the code has been committed, I'm leaving the issue open until I have
checked that the language spec is up-to-date and I have written the "What's
New" entry. I am holding off on both, though, unti any tweaks I make to the
import proc
Changes by Brett Cannon :
--
priority: normal -> release blocker
___
Python tracker
<http://bugs.python.org/issue2377>
___
___
Python-bugs-list mailing list
Un
Brett Cannon added the comment:
Notes on what to mention:
importlib.invalidate_caches()
doctests and ImportError now spitting out the full module name
ImportError's new attributes
--
___
Python tracker
<http://bugs.python.org/i
Brett Cannon added the comment:
More notes:
5% startup loss according to normal_startup; within realm of compiler
optimizations.
--
___
Python tracker
<http://bugs.python.org/issue2
New submission from Brett Cannon :
Importlib doesn't cover case-insensitivity on file extensions under Windows
(see test.test_import.test_import:
http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%203.x/builds/41/steps/test/logs/stdio).
Should add a test to test_importlib and the
New submission from Brett Cannon :
Right now importlib doesn't use what loader.load_module() returns as that was
what import.c did. But PEP 302 explicitly states that load_module() is expected
to return the module that was loaded. So to save a dict lookup I want to rely
on the return val
Brett Cannon added the comment:
You could just expose it, but on Windows I believe all extension modules are
builtins, so you should be able to properly use _winreg to get at the registry
and thus not require keeping the C code around.
But that's just a
Brett Cannon added the comment:
OK, is supporting this really necessary? It's a special case on Windows only;
even OS X which is also case-insensitive doesn't support this.
But if it does need to be supported, then does someone know if this extends to
all module types or only .p
Brett Cannon added the comment:
Another thing to note:
index does not default to -1 anymore but to 0; bug that should have gone away
in Python 2.7.
--
___
Python tracker
<http://bugs.python.org/issue2
Brett Cannon added the comment:
So IDLE broke because it was relying on buggy behaviour accidentally left in
Python 2.7 and carried forward (plus it was not updated to use best practices
like importlib.import_module()). Roger, can you try the patch I have uploaded
and see if that fixes
Brett Cannon added the comment:
I committed the fix. Thanks for testing, Roger.
As for the change in semantics, I'm fully aware it is not backwards-compatible.
Unfortunately the incorrect usage was not even discovered until I started my
bootstrap work because the import statement doe
New submission from Brett Cannon :
As it stands, test_import runs importlib.test.import_.test_relative_imports. It
would probably be better to have test_import run all importlib tests using
__import__(), especially since it is already coded up in
importlib.test.__main__ to do so.
In all
Changes by Brett Cannon :
--
components: +Tests
stage: -> needs patch
versions: +Python 3.3
___
Python tracker
<http://bugs.python.org/issue14585>
___
___
Py
Changes by Brett Cannon :
--
keywords: +easy
___
Python tracker
<http://bugs.python.org/issue14585>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
OK, crasher is fixed (as is importlib as it failed on the test case as well
thanks to the slicing of [:-0] returning the empty string instead of the entire
string).
And I will update the docs to be a bit more clear about things (at least those
docs have the
Brett Cannon added the comment:
This also means that the importlib.test.import_.util.importlib_only decorators
are probably all useless.
--
___
Python tracker
<http://bugs.python.org/issue14
Changes by Brett Cannon :
--
resolution: -> fixed
stage: test needed -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Brett Cannon added the comment:
Just because I was thinking about it, I wonder if necessarily all the frozen
stuff really needs to stay in import.c. I mean a frozen module is really just
an entry in an array of structs that has a name of an char*[]. I don't see why
one couldn't sim
Brett Cannon added the comment:
OK, so I have started to check this stuff in, but I think it's best to do it
piecemeal. Going forward I would like to commit in units of functions being
replaced, and prioritize stuff that cuts out C code (e.g. the load_*() methods,
find_module(), etc.).
Brett Cannon added the comment:
It looks like in order to get a clear sign of what it will take to remove
various parts of import.c, imp.load_module() needs to go along with
imp.load_package() (since they call each other in the C code). You also have to
take care of imp.reload(), but I am
Brett Cannon added the comment:
I am seeing how this is going to go down. the load_dynamic, load_source, etc.
family of functions are simply dispatched to by load_module(). So to keep some
semblance of backwards-compatibility, each of those modules need to be
implemented and then have
Brett Cannon added the comment:
What Benjamin said. PEP 328 should have done away with relative imports, but
somehow the __import__() function itself was not updated even though its docs
were changed to say that index defaulted to 0.
So this isn't actually a regressions because of impo
Brett Cannon added the comment:
I should also mention that the support for -1 indexing in Python 3 was weird
because support was partially removed, but some 'if' checks only did ``< 1``
and so negative indices didn'
Brett Cannon added the comment:
I'm fine w/ documenting load_dynamic() and leaving it as-is since importlib
uses the function itself (plus the frozen/builtin functions, although the
frozen stuff might be simplified since they can probably just return the bytes
for the frozen module in
Brett Cannon added the comment:
Just to clarify the failure for the bug history, somehow multiprocessing is not
ending up in sys.modules as expected. It changed from a SystemError to a
KeyError because I started to properly check a PyDict_GetItem() return value
instead of blindly assuming
Brett Cannon added the comment:
David, did you find load_source() convenient because you could specify the file
to use for the module's source? Did you actually like the file object argument?
Just trying to gauge if some new API is needed on a loader of if the one-liner
I proposed is
Brett Cannon added the comment:
>From Eric Smith on python-dev:
> +suffix, mode, type_ = details
> +if mode and (not mode.startswith(('r', 'U'))) or '+' in mode:
> +raise ValueError('invalid file open mode {!r}'.format(mode
Brett Cannon added the comment:
To help refine this, so you would expect all of the usual import stuff (e.g.
sys.modules use, generating bytecode, etc.), you just want a short-circuit to
the loading when you happen to already know the name and desired file path?
Basically I want to kill off
Brett Cannon added the comment:
Well, I want backwards-compatibility *now*, not forever.
And no, it is not an obvious API as you are asking for what loaders are
supposed to do; load a module, which is why the one-liner I gave you works
today. Finder simply find a loader that can load
Brett Cannon added the comment:
Issue #14581 covers the .PY failure (still looking for input on that one).
The path failure is from http://hg.python.org/cpython/rev/f341b99bb370 which
Brian committed.
The test_reprlib failure is because of a race condition where an
Brett Cannon added the comment:
Yeah, the fix is dead-simple, import with level=1 and if that fails import with
level=0.
I plan to cover this specific issue in the "What's New" for Python 3.3.
--
___
Python tracker
<http
Brett Cannon added the comment:
I think the failure is from a cache race condition. Hopefully the
invalidate_caches() call will fix things.
--
___
Python tracker
<http://bugs.python.org/issue14
New submission from Brett Cannon :
There should no longer be any implicit part of import when there doesn't have
to be. To make import fully explicit, some things need to happen (in context to
importlib):
* Expose FileLoader
* Expose SourceFileLoader
* Expose PathFinder
* Expose the exte
Brett Cannon added the comment:
Detecting if you are in a package is as simple as ``'.' in __name__ or
hasattr(mod, '__path__')`` or alternatively for the last guard, ``__name__ ==
__package__``.
As for the failure
Brett Cannon added the comment:
On Tue, Apr 17, 2012 at 06:51, Antoine Pitrou wrote:
>
> Antoine Pitrou added the comment:
>
> > Well, I want backwards-compatibility *now*, not forever.
>
> I don't think changing a function signature in an incompatible way is
> g
Brett Cannon added the comment:
I doubt I will beat you to it, Eric, but I did want to say that your overall
design was what I had in my head when I was thinking about how to re-implement
the function, so keep at it!
--
___
Python tracker
<h
Brett Cannon added the comment:
SystemError fixed (stemming from a misunderstanding of what
PyDict_GetItemWithError() did).
--
assignee: -> brett.cannon
resolution: -> fixed
stage: -> committed/rejected
status: open -> closed
___
Py
Brett Cannon added the comment:
Note:
__import__('sys', level=1) no longer works; raises KeyError instead.
--
___
Python tracker
<http://bugs.python.
Brett Cannon added the comment:
Importlib does away with this issue.
--
resolution: -> out of date
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.o
Changes by Brett Cannon :
--
components: +Library (Lib)
keywords: +easy
priority: normal -> low
versions: -Python 3.2
___
Python tracker
<http://bugs.python.org/issu
Brett Cannon added the comment:
This isn't a bug because the CSV format isn't malformed (which would be
appropriate for csv.Error), but the file itself isn't appropriate encoded (or
the proper encoding wasn't specified (hence UnicodeDecodeError). So the
exception is app
Brett Cannon added the comment:
@lys.nikolaou it looks like there was an initial PR, but it only updated things
for Bash and not for all the other shells that we support for virtual
environments.
--
nosy: +brett.cannon
___
Python tracker
<ht
Brett Cannon added the comment:
Virtual environments are not designed to be portable. For instance, if you have
entry points installed then moving them to another machine would break their
shebang lines. And even if you do it on your local machine there's no guarantee
something else w
Brett Cannon added the comment:
You can open a new PR with co-author or basing off of their fork if it's still
around.
--
___
Python tracker
<https://bugs.python.org/is
Brett Cannon added the comment:
I was just saying that this is an enhancement request, no judgment about
whether we want to solve the enhancement request.
--
___
Python tracker
<https://bugs.python.org/issue35
Brett Cannon added the comment:
@Carl Feel free to open new issues for whatever you need. :)
--
___
Python tracker
<https://bugs.python.org/issue21156>
___
___
Brett Cannon added the comment:
I agree with Eric. While I understand what Serhiy is saying about code objects
being more than a bytearray of bytecode, the buffer protocol is still a view on
an object, and that view happens to be for a subset which I think is acceptable
as I think of what a
Brett Cannon added the comment:
RE: "I think it needs significant benefits for typical users, not only for
Instagram. If only Instagram get benefit from this, keep it as Instagram's
internal patch."
But who's typical in this case? You? Me? We're talking code obj
Brett Cannon added the comment:
The inconsistency is a bit weird. Looking at
https://github.com/python/cpython/blob/master/Lib/pathlib.py#L825 the question
is why is self.name not being set for '.' but it is for '..'. I suspect there's
special-casing for '.
Change by Brett Cannon :
--
stage: -> test needed
___
Python tracker
<https://bugs.python.org/issue37130>
___
___
Python-bugs-list mailing list
Unsubscrib
Brett Cannon added the comment:
FYI when Guido said "call on the steering council" I think he meant open an
issue at https://github.com/python/steering-council/issues as this will get
lost otherwise (i.e. Guido already removed himself from the nosy list so this
already doesn&
Brett Cannon added the comment:
Changing VIRTUAL_ENV will break code, so I'm not sure if it's worth changing.
--
___
Python tracker
<https://bugs.python.o
Change by Brett Cannon :
--
nosy: +gpolo, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue37149>
___
___
Python-bugs-list mailing list
Unsub
Brett Cannon added the comment:
Let's please keep this respectful. Saying people are basing things "on fantasy"
or that "people need to develop reading skills" is not helpful.
--
___
Python tracker
<https:
Brett Cannon added the comment:
"if you coded bad and it doesn't work, it's your fault."
I disagree. Your request changes what VIRTUAL_ENV gets set to, correct?
Changing it suddenly for users doesn't mean their code was bad, it means we
changed something on them.
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue36964>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
+1 for Serhiy's suggestion
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue37163>
___
___
Pytho
Brett Cannon added the comment:
"I'm sorry, I thought "fantasy" was good metaphor."
No problem! Saying something is "fantasy" like "it's based on fantasy" -- in
North America at least -- is like sayin
Brett Cannon added the comment:
To help short-circuit this discussion and focus on the desired solution, the
steering council came to a decision that can be seen at
https://github.com/python/steering-council/issues/12#issuecomment-498874939 :
- for Python 3.8 specifically, we think it makes
Brett Cannon added the comment:
The imports are on purpose but they are not required for import to run, just
like importlib.resources isn't necessary.
--
___
Python tracker
<https://bugs.python.org/is
Brett Cannon added the comment:
@Brian: Probably not. The worry that came up during the steering council
meeting was bifurcating the docs could cause confusion as to why it was
different, which one was more "right", etc.
--
___
Pyth
Brett Cannon added the comment:
@Brian: And thanks for the experiment! It was an interesting idea to consider.
--
___
Python tracker
<https://bugs.python.org/issue37
Change by Brett Cannon :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue37162>
___
___
Python-bugs-list
Brett Cannon added the comment:
@serhiy: mind opening a new issue for your zipfile.Path worry?
--
___
Python tracker
<https://bugs.python.org/issue37
Brett Cannon added the comment:
Please do not add me back to the nosy list as I stand by my thinking that this
feature isn't worth pursuing. I understand you feel they are reasonable, Marco,
but I don't like the idea of changing what VIRTUAL_ENV gets set to when I
believe
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue36964>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue34850>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
assignee: -> brett.cannon
___
Python tracker
<https://bugs.python.org/issue37130>
___
___
Python-bugs-list mailing list
Unsubscrib
Brett Cannon added the comment:
OSError does have its constructor documented at
https://docs.python.org/3/library/exceptions.html#OSError (farther down the
page I think you're reading; you didn't provide the URL you're referring to so
I'm somewhat guessing). It is specif
Brett Cannon added the comment:
Fair enough. I've changed the title to point out only BaseException needs its
constructor documented as every other extension inherits from it and so its
cascades down.
--
resolution: not a bug ->
status: closed -> open
title: Si
Brett Cannon added the comment:
@Antoine: was there a design reason behind setting 'name' to '' when a Path
objects was initialized with '.'? Is it to implicitly represent the current
directory?
@N.P.: we will have to think through the implications of this as I
Brett Cannon added the comment:
@Antoine: Basically Path.with_name() fails under '.' but works with '..'
although with a somewhat odd result. And then after that is the fact that
Path('.').name is the empty string but for Path('..').name it's
Change by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue37271>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue37297>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Anything zipimport-related should stay separate as zipimport is not a part of
importlib. The other three will have to be looked at to see what exactly they
are testing to know whether they relate to importlib and the implementation of
import or not (my guess
Brett Cannon added the comment:
I also agree with Eric's assessment.
Thanks for the idea, Tim, but I'm closing this as rejected.
--
nosy: +brett.cannon
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Pyt
Change by Brett Cannon :
--
resolution: -> third party
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Brett Cannon :
If Activate.ps1 was made to not have substitutions upon generation and be an
entirely static file, then the file could be signed and thus not require people
to lower their security requirements in PowerShell in order to activate their
virtual environments
Brett Cannon added the comment:
I mentioned on python-ideas and opened https://bugs.python.org/issue37354 to
actually make the Activate.ps1 file static for security purposes.
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.
Brett Cannon added the comment:
> I am curious how you plan to achieve this without reducing the functionality
> of venv?
PowerShell has a full programming language and all details can be found in
pyvenv.cfg now as of Python 3.8. So Activate.ps1 can read that file to get what
it ne
Brett Cannon added the comment:
> How would you plan to replace the functionality where the venv's bin path is
> substituted into the script? Purely through introspecting its own path?
It's stored in pyvenv.cfg.
> I presume the security requirements you refer to a
Brett Cannon added the comment:
> Would it be appropriate to change the "choose" method to "choice"?
Yep, just make sure the tests still pass before and after the change. :)
> should the name of "test_pkgimport" instead be "test_pkg_import"?
S
Brett Cannon added the comment:
> How will this interact with EnvBuilder.install_scripts() (which explicitly
> states that it performs textual substitution)?
It won't, so that would have to change as well. As you mentioned, Paul, I don't
know who even uses the functio
Change by Brett Cannon :
--
versions: +Python 3.9
___
Python tracker
<https://bugs.python.org/issue37354>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
New changeset a0d73a143af404deecb9c4fcdbd3ddbafd96b41b by Brett Cannon (Joannah
Nanjekye) in branch 'master':
bpo-30202 : Update test.test_importlib.test_abc to test find_spec() (GH-12847)
https://github.com/python/cpyt
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Brett Cannon :
I've been asked enough times about what directory name to use for virtual
environments I'm going to update
https://docs.python.org/3/library/venv.html#module-venv to suggest `.venv` if
you don't have a specific name (`.env` clashes with envir
Brett Cannon added the comment:
I can't reproduce:
>>> from importlib import abc
>>> from . import util
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'util' from '__main__' (unknown location)
&
Brett Cannon added the comment:
PEPs are not living documents unless they are marked as Active (which PEP 451
is not).
--
___
Python tracker
<https://bugs.python.org/issue23
Brett Cannon added the comment:
The import machinery docs are split between the language reference and
importlib itself. It really depends on what you're looking for.
--
___
Python tracker
<https://bugs.python.org/is
Brett Cannon added the comment:
> Mostly looking for something that says how `create_module` should / shouldn't
> be implemented
Basically you only need to provide the method if you want to use a custom
object for the module itself. So as long as the object can quack like a mod
Brett Cannon added the comment:
Feel free to open a new issue to propose changing it.
--
___
Python tracker
<https://bugs.python.org/issue23014>
___
___
Pytho
Brett Cannon added the comment:
Please open a separate issue for the relative import issue.
--
stage: resolved -> test needed
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue37416>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Do realize the person who created and closed this issue is the one suggesting
you open a new issue. ;) We can re-evaluate decisions and this one is 5 years
old. Now I'm not making any promises that we will definitely change anything,
but I'm no
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +14275
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14458
___
Python tracker
<https://bugs.python.org/issu
Brett Cannon added the comment:
New changeset f9f8e3ce709ceb15c8db8c8dde940daf1febf13d by Brett Cannon in
branch 'master':
bpo-37403: Touch up venv docs (GH-14458)
https://github.com/python/cpython/commit/f9f8e3ce709ceb15c8db8c8dde940d
Change by Brett Cannon :
--
versions: +Python 3.8, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue37409>
___
___
Python-bugs-list mailin
New submission from Brett Cannon :
builtins.__import__() raises ValueError (as it did in Python 2.7) while
importlib.__import__() raises ImportError (which makes more sense to me).
Found by Ben Lewis.
--
components: Interpreter Core, Library (Lib)
messages: 346855
nosy: Ben Lewis2
Brett Cannon added the comment:
I opened bpo-37444 for the relative import beyond top-level package issue.
--
___
Python tracker
<https://bugs.python.org/issue37
2101 - 2200 of 5934 matches
Mail list logo