Eric Snow added the comment:
The failure output with -v:
...
# /home/esnow/projects/cpython/Lib/http/__pycache__/__init__.cpython-33.pyc
matches /home/esnow/projects/cpython/Lib/http/__init__.py
# code object from
/home/esnow/projects/cpython/Lib/http/__pycache__/__init__.cpython-33.pyc
Eric Snow added the comment:
Here's a simple patch the allows bogus names in the fromlist. I'm going to
verify that this matches the 3.2 semantics, which may not be so cut-and-dry.
--
keywords: +patch
Added file: http://bugs.python.org/file26876/issue
Eric Snow added the comment:
The following seems to indicate that an ImportError should be raised as
expected. I'm guessing that somewhere along the line the exception gets
silently eaten.
--
(3.2) Python/import.c:ensure_fromlist() [1]
submod = import_subm
Eric Snow added the comment:
When people want to import modules with "runtime" names, they regrettably turn
to __import__() and likely will for a while. What a source of headaches!
If it were less convenient to use __import__(), perhaps fewer people would use
it. Could we remo
Changes by Eric Snow :
--
stage: needs patch -> patch review
___
Python tracker
<http://bugs.python.org/issue14905>
___
___
Python-bugs-list mailing list
Un
New submission from Eric Snow:
When people want to import modules with "runtime" names, they regrettably turn
to __import__(), have done so for many years, and likely will for a while.
If it were less convenient to use __import__(), fewer people would use it. I'm
putting t
Eric Snow added the comment:
I've taken the tanget over to issue15720.
--
___
Python tracker
<http://bugs.python.org/issue15715>
___
___
Python-bugs-list m
Eric Snow added the comment:
Here's the deal. import_module_level() gets called for v1 from sa (where
"globals" comes from). In that function it first calls get_parent(), which
returns a borrowed reference to the sa module object. Then that parent object
is passed to load_n
Eric Snow added the comment:
Would issue14803 be sufficient? Certainly not quite as concise, but deferring
to that solution would limit the proliferation of command-line arguments to the
interpreter.
--
___
Python tracker
<http://bugs.python.
Eric Snow added the comment:
Ah, __import__() is used all over the place in the stdlib. I won't have time
right away to put together the patch then. However, here's what I'm planning:
* expose builtin___import__() (from Python/bltinmodule.c) as imp.__import__().
* expose
New submission from Eric Snow:
In issue 15316 (msg168896, Brett Cannon):
Create a ModuleNotFoundError exception that subclasses ImportError
and catch that (breaks doctests and introduces a new exception that
people will need to be aware of, plus the question of whether it
should just
Eric Snow added the comment:
> While I prefer 3, I think it's a bit late in the release to try to
> introduce a new exception to begin separating the meaning of 16
> different ``raise ImportError`` cases in importlib._bootstrap based on
> inheritance. My gut says 4 is the best s
Eric Snow added the comment:
FWIW, the patch looks good to me. This is probably the last week to get this
in for 3.3.0.
--
___
Python tracker
<http://bugs.python.org/issue15
Eric Snow added the comment:
here's a test. I'll work on a patch when I get a chance (and no one's beaten
me to it :).
--
keywords: +patch
nosy: +eric.snow
Added file: http://bugs.python.org/file26980/issue2051_test.eric.snow.diff
___
Eric Snow added the comment:
So this boils down to set_data() not having a mode parameter, right? Alas,
the obvious approach, adding it, breaks backward compatibility. The
alternative is to use source_from_cache() in set_data() to get the source path,
and then get the mode there. Of
Changes by Eric Snow :
--
stage: -> needs patch
___
Python tracker
<http://bugs.python.org/issue2051>
___
___
Python-bugs-list mailing list
Unsubscri
Eric Snow added the comment:
My patch was very similar. _cache_bytecode() is a good addition. Good point
about the cache, too.
I'm not convinced that source_path is the right thing to add to the API (even
just for SourceFileLoader). I would have thought mode would have been
Eric Snow added the comment:
So this was a random one-off (hardly even intermittent) failed test that passed
on the retry. Ah, threads. Is there an easy way to find all other failures in
test_threaded_import in the past, for this and for all buildbots? Do we have
information about load
Eric Snow added the comment:
(sorry, only saw the first couple messages)
--
___
Python tracker
<http://bugs.python.org/issue15781>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Here's a patch for 3.3 with a test. Though, I'm still setting up my windows
box for building Python, I wanted to get this patch up. On its own the test
should fail on Windows. In that case, it should be backport-able. If no one
has a chance to verif
Eric Snow added the comment:
Doesn't EIO cover pathologies which we don't want to silence? I could see
adding EROFS though.
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.o
Eric Snow added the comment:
I was thinking along the same lines, though it might make sense for EROFS and a
few others. (http://aplawrence.com/Unixart/errors.html)
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue15
Eric Snow added the comment:
Well, the workflow on Windows is certainly different. I've run out of time to
get this sorted out in the short term. However, the patch should be pretty
close to what's needed. Obviously the posix-only bit doesn't fit for a
Window
Eric Snow added the comment:
As far as the import system goes, Barry Warsaw added a really nice page to the
language reference[1]. However, it sounds like your concern is with taking
advantage of the tools that importlib provides.
First of all, a good thing to recognize is that importlib
Eric Snow added the comment:
Wouldn't the following also start working (currently a NameError)?
class X:
def f(self):
print(f.__qualname__)
def g(self):
f(None)
X().f()
X().g()
How about this[1] (also currently a NameError):
class Outer:
Eric Snow added the comment:
Actually, that second would still not work (it would have to pass through the
non-lexical inner scope that Nick mentioned). Is that also the case for the
first one?
--
___
Python tracker
<http://bugs.python.
Eric Snow added the comment:
sounds like it would be worth a shot
--
___
Python tracker
<http://bugs.python.org/issue12370>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
In Python 2 the code example generates an old-style class. When I tried it
with a new style class, it worked fine:
class Wrapper(object):
@staticmethod
def __getattr__(item):
return repr(item) # dummy
a = Wrapper()
print(a.foo
Eric Snow added the comment:
yeah, I keep thinking we need a better API for managing tracebacks. One of
these days...
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue15
Eric Snow added the comment:
This comes back to #14657, which addressed the frozen vs. non-frozen copies of
importlib. It sounds like one useful solution for your situation would be for
_frozen_importlib to be used only long enough for bootstrap purposes. This was
discussed in that other
Eric Snow added the comment:
The FileFinder class (a "path entry finder") uses a cache to efficiently track
changes to files. You can manually clear this cache by calling
importlib.invalidate_caches(). The Python test suite has several examples of
clearing the FileFinder cache i
Changes by Eric Snow :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue15912>
___
___
Python-bugs-list mailing list
Unsubscri
Eric Snow added the comment:
Thinking about it, it may be worth adding a note to the docs for sys.modules
making it clear about importlib.invalidate_caches(). I'll see about writing up
a patch when I get a chance.
--
status: pending -&
Eric Snow added the comment:
The relationship between invalidate_caches() and sys.modules is definitely
tenuous. However, my rationale was that people would look for an explanation
on why modifying sys.modules was not working as expected. The sys.modules doc
entry was the one that seemed to
Eric Snow added the comment:
Yikes. I'll get a patch up tonight.
--
assignee: -> eric.snow
___
Python tracker
<http://bugs.python.org/issue16160>
___
_
Eric Snow added the comment:
Here's a patch that fixes subclass support. It was supposed to work in the
first place. Guess I had tunnel vision at the time.
The fix is essentially a copy of the code in dict_new() in
Objects/dictobject.c. I left out the part about releasing GC if the ty
Changes by Eric Snow :
Removed file: http://bugs.python.org/file27512/issue16160.diff
___
Python tracker
<http://bugs.python.org/issue16160>
___
___
Python-bugs-list m
Eric Snow added the comment:
Here's an updated patch that addresses Éric's review comments.
--
Added file: http://bugs.python.org/file27524/issue16160.diff
___
Python tracker
<http://bugs.python.o
Eric Snow added the comment:
> For 3.4, I plan to have a look at the organically-grown-over-time mess
> that is CPython's current interpreter initialisation system and see if I
> can figure out something a bit more sane and easier to configure/control
> (especially when embe
Eric Snow added the comment:
Am I good to commit this?
--
___
Python tracker
<http://bugs.python.org/issue16160>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Snow :
___
Python tracker
<http://bugs.python.org/issue12486>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/
New submission from Eric Snow:
While traversing the passed iterable, untokenize() will go to "compatibility
mode" one it hits a 2-tuple instead of a 5-tuple (coming from the iterable).
That token will not go through the normal steps that other tokens do. Most
critically, if tha
Changes by Eric Snow :
--
keywords: +patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file27559/untokenize_compat.diff
___
Python tracker
<http://bugs.python.org/issu
New submission from Eric Snow:
If you pass an iterable of tokens and none of them are an ENCODING token,
tokenize.untokenize() returns a string. This is contrary to what the docs say:
It returns bytes, encoded using the ENCODING token, which is the
first token sequence output by
New submission from Eric Snow:
When tokenize.untokenize() encounters a 2-tuple, it moves to compatibility
mode, where only the token type and string are used from that point forward.
There are two closely related problems:
* when the iterable is a sequence, the portion of the sequence prior
Eric Snow added the comment:
issue16224 _may_ supercede this ticket.
--
components: +Library (Lib)
___
Python tracker
<http://bugs.python.org/issue16221>
___
___
Eric Snow added the comment:
Actually, here's a patch with the first option. It preserves iterators as
iterators, rather than dumping them into a list. I've also rolled the tests
from issue16221 into this patch. Consequently, if the patch is suitable, that
issue can
Eric Snow added the comment:
The patch that I have in #16224 takes care of this issue. If that issue goes
in another direction however...
--
status: open -> pending
superseder: -> tokenize.untokenize() misbehaves when moved to "compati
New submission from Eric Snow:
In Objects/typeobject.c, reduce_2() makes _PyObject_GetAttrId() calls to pull
some methods for the object in question. This is a problem when the object's
type defines __getattr__() or __getattribute__() and returns something like
None when the attribute i
Changes by Eric Snow :
--
title: object.__reduce__() -> some special methods are looked up on the
instance rather than the type
___
Python tracker
<http://bugs.python.org/issu
Eric Snow added the comment:
> Before any change gets made, it should be discussed on python-dev
> (especially if you intend on backporting the change).
Agreed.
--
___
Python tracker
<http://bugs.python.org/i
Eric Snow added the comment:
Rather, importlib.import_module(). :)
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue16259>
___
___
Python-bug
Eric Snow added the comment:
The catch is that when abstractmethod is the inner decorator,
__isabstractmethod__ is set on the object that classmethod/staticmethod is
wrapping. When abstractmethod is the outer decorator, __isabstractmethod__ is
set on the resulting classmethod/staticmethod
Eric Snow added the comment:
Sounds good. Thanks for getting this done, Nick.
--
___
Python tracker
<http://bugs.python.org/issue6074>
___
___
Python-bugs-list m
Eric Snow added the comment:
> Given how confusing it seems, perhaps we should change it to
> adopt a PATH-like behaviour.
Wouldn't that introduce a backward-compatibility issue? FWIW, otherwise I
agree that it makes a lot of sense to conform to the same behavior as PATH.
Eric Snow added the comment:
It does not necessarily require a metaclass. You can accomplish it using a
custom descriptor:
class classattr:
def __init__(self, getter):
self.getter = getter
def __get__(self, obj, cls):
return self.getter(cls)
FWIW, this is a descriptor
Eric Snow added the comment:
Both abstractnethod and abstractproperty work by setting __isabstractmethod__
to True on the decorated function. Then type.__new__ looks for any attributes
of the current class (including inherited ones) that have __isabstractmethod__
set to True. The signature
Eric Snow added the comment:
Oops, typos.
> Both abstractmethod and abstractproperty work by setting
__isabstractmethod__ to True on the decorated function. Then type.__new__
That should be type.__call__ or object.__new__, I don't remember which.
> looks for any attributes of
Eric Snow added the comment:
Also be sure the have Raymond's sign-off before committing anything for this. :)
--
___
Python tracker
<http://bugs.python.org/is
Eric Snow added the comment:
Review posted. Thanks for working on this, Brett.
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17621>
___
___
Eric Snow added the comment:
I wonder if there would be any benefit to using this for some of the modules
that get loaded during startup. I seem to remember there being a few for which
lazy loading would have an effect.
--
___
Python tracker
Eric Snow added the comment:
New review posted. Basically LGTM.
--
___
Python tracker
<http://bugs.python.org/issue17621>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Review posted.
--
___
Python tracker
<http://bugs.python.org/issue20942>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Thanks, Yury!
--
___
Python tracker
<http://bugs.python.org/issue17373>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Latest patch LGTM.
--
___
Python tracker
<http://bugs.python.org/issue20942>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
As I've thought about it, I've gone from -0 to +1 on applying this to both 3.4
and 3.5. The bug and fix should impact very little* code. In fact, I doubt
anyone would have noticed if Nick hadn't. :) It would be nice to have this
right in 3.4.
New submission from Eric Snow:
While reviewing code[1] for issue 20942, I noticed that when someone uses
imp.frozen_init[2], the module is removed from sys.modules in some error cases.
However, this should not be done when the module already exists (e.g. reload).
As Brett pointed out in his
Eric Snow added the comment:
The only concrete example I can think of that would be impacted is using PJE's
lazy loader on a frozen module, and even that is unlikely to trigger the error
case.
--
nosy: +pje
___
Python tracker
Eric Snow added the comment:
Martin: are you okay with Claudiu's latest patch?
--
___
Python tracker
<http://bugs.python.org/issue19714>
___
___
Python-bugs-l
New submission from Eric Snow:
In Python/sysmodule.c (_PySys_Init), the SET_SYS_FROM_STRING_BORROW macro is
created right next to SET_SYS_FROM_STRING. However, while SET_SYS_FROM_STRING
is unset at the end of _PySys_Init, SET_SYS_FROM_STRING_BORROW is not unset.
I expect that it should be
Eric Snow added the comment:
Here's a basic patch. It introduces __main__ in import.rst and then identifies
the cases where __spec__ is set to None or otherwise.
There are a few :ref: links to labels on other pages that I had trouble with.
I'll address those when I put up a new d
Eric Snow added the comment:
A related addition (Lib/test/test_importlib/test_api.py -
test_reload_namespace_changed):
changeset: 86819:88c3a1a3c2ff3c3ab3f2bd77f0d5d5e5c1b37afa
parent: 86816:13a05ed33cf7
user:Eric Snow
date:Thu Oct 31 22:22:15 2013 -0600
summary
Eric Snow added the comment:
Thanks, Benjamin.
--
___
Python tracker
<http://bugs.python.org/issue21089>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
That did the trick, Nick. I swear there's always something I forget about
ReST. :)
Otherwise do you have any objections to the patch? I imagine there's more we
could put in the section (for language spec purposes), but I figure what I have
there is g
Eric Snow added the comment:
Wish I had done that in the opposite direction. Anyway, thanks Nick.
--
resolution: -> fixed
stage: test needed -> committed/rejected
status: open -> closed
versions: +Python 3.5
___
Python track
Eric Snow added the comment:
Here's a patch that adds the test. However, the test is failing and my gut's
telling me it's a legitimate failure. I'll verify as soon as I have a chance
and open a new issue if it is legit (i.e. a regression in 3.4, albeit an
unlikely corne
Eric Snow added the comment:
> P.S.
> I'm not sure exactly how the regular development protocol
> goes around here so, just for the record, please know that no
> offense in intended with this ping. :-)
What you did is just right. The offer to help move things along is
b
Changes by Eric Snow :
--
nosy: -eric.snow
stage: -> patch review
versions: +Python 3.5
___
Python tracker
<http://bugs.python.org/issue19983>
___
___
Python-
Eric Snow added the comment:
Well, the same patch (modulo adjusting to apply cleanly) fails in exactly the
same way in 3.3. So either the test isn't right or namespace packages have
never supported reload in this way. I'll keep inv
Eric Snow added the comment:
Regarding this issue, keep in mind that namespace packages have a dynamic
__path__ which already updates (effectively) when new portions are added to
sys.path. So we just need to make sure that reloading does not break that.
To that end, here's a much si
New submission from Eric Snow:
While working on #19711 it dawned on me that test_namespace_pkgs might be more
appropriate as a submodule of test_importlib. The feature doesn't have it's
own module nor is it otherwise independent of importlib.
I don't want to introduce churn he
New submission from Eric Snow:
(from msg207510 in issue 18864)
There are a few lingering to-do comments:
Lib/test/test_importlib/extension/test_case_sensitivity.py:# XXX find_spec tests
Lib/test/test_importlib/extension/test_finder.py:# XXX find_spec tests
Lib/test/test_importlib/source
New submission from Eric Snow:
(from msg202657 in issue 18864)
A bunch of importlib (and other?) tests make direct calls to find_module(),
find_loader(), or load_module(). These are still working, as expected.
However, we should probably either replace them or supplement them with
Changes by Eric Snow :
--
dependencies: +Address remaining PEP 451-related to-do comments., Switch
applicable importlib tests to use PEP 451 API
___
Python tracker
<http://bugs.python.org/issue18
Changes by Eric Snow :
--
assignee: -> eric.snow
___
Python tracker
<http://bugs.python.org/issue19711>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric Snow added the comment:
Agreed. :)
--
___
Python tracker
<http://bugs.python.org/issue21099>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
I've gone ahead and moved all remaining work into separate issues. Once the 4
remaining sub-issues are resolved, this one can be closed. I've *finally* got
a couple days free so I want to clos
Eric Snow added the comment:
Lib/test/test_importlib/test_windows.py is addressed in #19714
#21099 should cover the other four. If any *new* tests are needed we can
address them in this ticket.
--
___
Python tracker
<http://bugs.python.
Eric Snow added the comment:
I seriously need to remember to apply to 3.4 and merge forward! :P
--
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Eric Snow added the comment:
I don't anticipate any more tests for now.
--
resolution: -> rejected
stage: test needed -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.pyth
Eric Snow added the comment:
Here's a patch. In most spots I'm left things alone.
There is a comment in the docstring for test_abc.SourceOnlyLoaderTests about
reload-related tests and module_for_loader (which is deprecated now). I'm not
going to worry abo
Changes by Eric Snow :
--
nosy: +eric.snow
versions: +Python 3.5 -Python 3.2, Python 3.3
___
Python tracker
<http://bugs.python.org/issue4712>
___
___
Python-bug
Eric Snow added the comment:
Sweet!
--
___
Python tracker
<http://bugs.python.org/issue17621>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Eric Snow added the comment:
source_to_code() seems like a good fit on InspectLoader to me. Is there
something in particular that motivated the idea of moving it up to Loader?
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.
Eric Snow added the comment:
Sounds good to me.
--
___
Python tracker
<http://bugs.python.org/issue20383>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Now that I've thought about it a little more, I'm more open to the idea.
Source is definitely a universal concept in Python, as is code. So
source_to_code() makes some sense on a most-base type like Loader. On the
other hand, source isn't necessa
Eric Snow added the comment:
I made roughly the same point in the current import-sig thread that relates
here:
https://mail.python.org/pipermail/import-sig/2014-April/000805.html
Basically, I agree we should be careful with both __name__ and __file__
Changes by Eric Snow :
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue21181>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
I don't see a review link. Looks like your patch wasn't against tip (at
attach-time) or you used the --git flag in diff. Having the patch in the
review tool would be really would be really helpful. I'll take a look
otherwise, but won't be
New submission from Eric Snow:
Prior to 3.4, pkgutil.get_loader('__main__') would return None. Now it results
in an ImportError. That's because it calls importlib.util.find_spec() which
fails if an existing module does not have __spec__ or it is None.
--
component
1601 - 1700 of 2629 matches
Mail list logo