Brett Cannon added the comment:
I am running the test suite now using the "secret" attribute on ImportError. I
tried to pass a flag, but locking became a bit messy/complicated. And I also
realized that if I didn't do this then using different implementation of
import_ in imp
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:
Didn't patch it in to evaluate the surrounding code, but otherwise the patch
LGTM.
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org
Brett Cannon added the comment:
So Alex's point is valid: the examples in the unittest.mock.patch docs shows
how to do this
(http://docs.python.org/dev/py3k/library/unittest.mock.html#patch). So this
could be simplified to:
def redirect_stdout(replacement=None):
return unittest.mock.
Brett Cannon added the comment:
LGTM
--
___
Python tracker
<http://bugs.python.org/issue15828>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.pyth
New submission from Brett Cannon:
Sometime in the last month (probably) I change has been made in either
configure(.ac), Makefile.pre.in, or setup.py that is causing the -s option
passed to make to not also make its way into setup.py when extensions are built.
--
components: Build
New submission from Brett Cannon:
2to3 isn't (ironically) translating lib2to3 so that it can run under Python 3:
File
"/Users/bcannon/Developer/repo/benchmarks_py3k/lib/2to3/lib2to3/fixes/fix_operator.py",
line 89, in _check_method
method = getattr(self, "_&qu
Brett Cannon added the comment:
So it might be a change, but I don't know if I would claim it is a regression
that needs changing. If you can't write bytecode files for some reason other
than permissions or the file already exists then there is something wrong with
your setup that
Brett Cannon added the comment:
On Fri, Aug 31, 2012 at 6:42 PM, Antoine Pitrou wrote:
>
> Antoine Pitrou added the comment:
>
> > Might need to let Python 3 use its stdlib copy of lib2to3. Otherwise
> > will need to come up with a way to have two copies of a library, one
Changes by Brett Cannon :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue15844>
___
___
Python-bugs-list mailing list
Unsubscri
Brett Cannon added the comment:
First off, what you want to do isn't easy to begin with. =) You are right that
you want get_code() and that SourceLoader is what you want. The problem is that
importlib inherited PEP 302s APIs, and there are so many that the docs don't
repeat the
Changes by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<http://bugs.python.org/issue10224>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
How can you load a C extension without a file path? Are C extensions being
inappropriately flagged as built-in modules on Windows? What does
imp.find_module() return for the module being checked? I need more debugging
info on what imp.find_module() and
Brett Cannon added the comment:
Well, that's extremely annoying as that doesn't work for .py or .pyc files::
>>> import imp
>>> stuff = imp.find_module('blah')
>>> stuff
(<_io.TextIOWrapper name=4 mode='U' encoding='utf-8'&g
Changes by Brett Cannon :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue15902>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
I don't think sys.modules is the right place about a warning regarding
importlib.invalidate_caches(); this has nothing to do with sys.modules but
instead import itself. Probably something more along those lines would be more
fitting.
This is also mentione
Brett Cannon added the comment:
I'm going to guess this is a shortcoming of pdb when it comes to frozen modules
as I can get to the source using inspect (which pdb leans on)::
>>> len(inspect.findsource(_frozen_importlib)[0])
1761
>>> len(inspect.findsource(importl
Brett Cannon added the comment:
It's translating properly for me now as well (but on a different machine). I
will give it another try when I get home to see if I can reproduce success on
the machine that was failing for me previously.
--
status: pending -&
Changes by Brett Cannon :
--
assignee: benjamin.peterson -> brett.cannon
___
Python tracker
<http://bugs.python.org/issue13990>
___
___
Python-bugs-list mai
Brett Cannon added the comment:
I just checked and this is no longer an issue in Python 3.3.
The sys.modules "bug" isn't a bug as that's how it is supposed to work to
prevent partially initialized modules. As for how pickle is doing stuff, that
could change if it woul
Brett Cannon added the comment:
Quick glance at the patch LGTM. I don't have commit access handy so I can't do
it myself ATM.
--
nosy: +brett.cannon
stage: -> commit review
___
Python tracker
<http://bugs.pytho
Brett Cannon added the comment:
First off, that assertEquals should have a custom error message stating what
values the date objects had to better tell how off things were.
Second, this can probably be solved by upping the timedelta to something like a
minute or something for when it's r
Brett Cannon added the comment:
I can't reproduce the problem anymore.
--
resolution: -> out of date
status: open -> closed
___
Python tracker
<http://bugs.python.
Changes by Brett Cannon :
--
versions: +Python 3.4 -Python 3.3
___
Python tracker
<http://bugs.python.org/issue10224>
___
___
Python-bugs-list mailing list
Unsub
Brett Cannon added the comment:
Can you copy-and-paste the exact commands you are using to build and run the
benchmarks (along with version info for the interpreter used to do the
building) as I'm on the same revision and can't reproduce anymore?
$ mkdir benchmarks_py3k
$ cd bench
Brett Cannon added the comment:
So the tests failed but the benchmarks finished without issue? I'm not too
worried about the tests since they are almost all str/bytes interaction issues
(although I don't get the .decode() failure). If the benchmarks run without
errors then I'm
Brett Cannon added the comment:
I should mention that http://bugs.python.org/issue10967 exists as a meta issue
about trying to gut regrtest in favour of using other things in unittest (and
doctest in this case) when possible.
--
___
Python tracker
Changes by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<http://bugs.python.org/issue15415>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Brett Cannon:
It would be nice to have something like sphinx's build output where the output
is all kept on a single line except for failures.
The color would help when scrolling through current output looking for
failures. Currently I just look until the failure
Brett Cannon added the comment:
I totally agree, I just wanted this in the tracker as a long-term goal to have.
I have made this a dependency on issue #10967 which is tracking moving regrtest
over unittest as much as possible.
--
dependencies: +move regrtest over to using more
Changes by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<http://bugs.python.org/issue15987>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Brett Cannon :
--
versions: +Python 3.4 -Python 3.2, Python 3.3
___
Python tracker
<http://bugs.python.org/issue16027>
___
___
Python-bugs-list mailin
Changes by Brett Cannon :
--
title: Tuple extraction in lambda isn't supported with more than one argument
-> Tuple extraction in a lambda isn't supported by 2to3
___
Python tracker
<http://bugs.pytho
Changes by Brett Cannon :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue13028>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from Brett Cannon:
It's probably time to examine what modules are imported at startup and whether
they are necessary or if some can be trimmed off so as to avoid the overhead.
--
messages: 171733
nosy: brett.cannon
priority: normal
severity: normal
status: open
Brett Cannon added the comment:
This should probably use concurrent.futures instead of multiprocessing
directly, but yes it would be useful.
Then again, the whole module should probably be rewritten to use importlib as
well.
--
components: +Library (Lib)
nosy: +brett.cannon
priority
Brett Cannon added the comment:
I can't, so setting to pending so that if no one speaks up the issue will close.
--
status: open -> pending
___
Python tracker
<http://bugs.python.org
Changes by Brett Cannon :
--
dependencies: +Speedup sysconfig startup, locale can be imported at startup but
relies on too many library modules
___
Python tracker
<http://bugs.python.org/issue16
Brett Cannon added the comment:
It's actually a nice example of using unittest.mock. =)
--
nosy: +brett.cannon
___
Python tracker
<http://bugs.python.org/is
Changes by Brett Cannon :
--
superseder: -> Add SHA-3 (Keccak) support
___
Python tracker
<http://bugs.python.org/issue16118>
___
___
Python-bugs-list mai
Changes by Brett Cannon :
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue16118>
___
___
Python-bugs-
Brett Cannon added the comment:
How are people finding these uses? Grepping around for yield and seeing if it
is in a 'for' loop? Or are people doing something more detailed like an AST
walk of every module in the stdlib looking for some pattern?
--
nosy: +br
Changes by Brett Cannon :
--
keywords: +3.2regression
resolution: fixed ->
status: closed -> open
versions: +Python 3.4
___
Python tracker
<http://bugs.python.org/i
Brett Cannon added the comment:
http://hg.python.org/cpython/rev/dc18a2a66d16 did add a test, just not the
right one.
--
___
Python tracker
<http://bugs.python.org/issue15
Brett Cannon added the comment:
Actually, I take it back, it removed a test without adding a new one. Obviously
that's my bad.
--
___
Python tracker
<http://bugs.python.org/is
Brett Cannon added the comment:
Finder is only documented as deprecated; actually making it work with a
reasonable warning is too much of a pain for such little gain. So it can just
stay in as there is no maintenance burden.
--
___
Python tracker
Brett Cannon added the comment:
This can get fixed in 3.3.1, which is why I left Python 3.3 as an affected
version.
Hopefully I can get to a fix this week. I need to write a test showing that a
module that doesn't exist as specified in a fromlist is silently ignored, but
if a module
Brett Cannon added the comment:
Here are two possible tests.
1) __import__('distutils', fromlist=['_i_do_not_exist']) should return distutils
2) Use a fake loader which executes some code which does nothing more than
tries to import a non-existent module. The trick with t
Changes by Brett Cannon :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue15111>
___
___
Python-bugs-list
Brett Cannon added the comment:
Did this actually work in a previous version of Python, and if so what version?
--
nosy: +brett.cannon
status: open -> pending
___
Python tracker
<http://bugs.python.org/issu
Brett Cannon added the comment:
It's actually a documentation bug.
--
assignee: -> docs@python
components: +Documentation -Library (Lib)
keywords: +easy
nosy: +docs@python
___
Python tracker
<http://bugs.python.org
Brett Cannon added the comment:
Before this gets out of control I want to clarify that it is not "quite absurd"
to label this a documentation bug and that is the proper classification for
this bug. The documentation was not clear enough for you to understand what the
behavior would
Brett Cannon added the comment:
The new functional equivalent is importlib.machinery.ExtensionFileLoader
(http://docs.python.org/dev/py3k/library/importlib.html#importlib.machinery.ExtensionFileLoader),
but underneath the hood it uses the same code as imp.load_dynamic() did
New submission from Brett Cannon:
IOW make _w_long, _r_long, and __fix_co_filename public so as to not be some
special ability that only importlib has.
--
components: Library (Lib)
messages: 172751
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
status: open
Brett Cannon added the comment:
Well, it means importlib becomes a special library and that no one could ever
replicate it as a third-party library.
Now if we can expose the various APIs around this such that they are abstracted
away then it isn't a big deal. That can be done for the _r
Brett Cannon added the comment:
http://bugs.python.org/issue15031 would deal with not needing to expose _r_long
and _w_long, but that still means people are screwed for _fix_co_filename. You
could argue that is a margin use-case, though.
--
dependencies: +Split .pyc parsing from
Brett Cannon added the comment:
I don't remember.
--
resolution: fixed ->
stage: -> patch review
status: closed -> open
___
Python tracker
<http://bugs.pyt
Brett Cannon added the comment:
_w_long and _r_long originally came from marshal; forgot I re-implemented them
in pure Python in the end.
--
___
Python tracker
<http://bugs.python.org/issue16
Changes by Brett Cannon :
--
resolution: -> duplicate
status: open -> closed
superseder: -> 'exceptions' import fixer
___
Python tracker
<http://bugs
Brett Cannon added the comment:
One thing to be aware of, Ramchandra, is that there might be a slight
backwards-compatibility problem from tightening up what exceptions propagate.
Now with proper documentation and only applying things to 3.4 this probably
won't be a problem.
--
Brett Cannon added the comment:
There is no patch, Djoume, but honestly that's fine since if you want to submit
a change to something it should go in a new issue.
But honestly compileall needs to be rewritten in Python 3.4 to use importlib
and have it control when source code shou
New submission from Brett Cannon:
Discovered on OS X 10.8 with clang 3.1, I'm having build failures for _json,
_md5, _sha1, _sha256, _sha3, and _sha512 because _PyUnicode_CheckConsistency()
is only defined when defined(Py_DEBUG) && !defined(Py_LIMITED_API) even though
it is
Brett Cannon added the comment:
Just to double-check I didn't screw up, I ran ``make distclean; ./configure;
make -j8`` and the problem persists.
It is *only* files compiled through setup.py and not by the Makefile. I do not
have OPT set, but I do have CFLAGS defined. But even if I expli
Brett Cannon added the comment:
I managed to fix it, but I did such a large swath of fixes that I need a little
time to narrow down what did it. Report back later.
--
___
Python tracker
<http://bugs.python.org/issue16
Brett Cannon added the comment:
Well that was extremely frustrating to find out. Turns out a copy of
Lib/_sysconfigdata.py was lingering in my checkout and .hgignore was hiding
that fact from me. Fixed .hgignore, deleted the wayward file, and everything is
now fine.
--
resolution
Changes by Brett Cannon :
--
assignee: -> brett.cannon
___
Python tracker
<http://bugs.python.org/issue10966>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Brett Cannon :
--
versions: +Python 3.4 -Python 3.3
___
Python tracker
<http://bugs.python.org/issue10966>
___
___
Python-bugs-list mailing list
Unsub
Brett Cannon added the comment:
I assume you mean for 3. to fix PyImport_ImportFrozenModuleObject() and not
stop resetting __file__ for _frozen_importlib in importlib.__init__ like we are
currently doing. I think you're right that it could wait until 3.5 as it will
only be apparent to p
Brett Cannon added the comment:
Is it confusing though? If you only had the latter exception all you would know
is Python doesn't consider datetime a package but you wouldn't know why that is
unless you knew the exact definition (the __path__ attribute exists). Having
the former
Brett Cannon added the comment:
Step 1 was just checked in.
Step 2: Jurko can you see if the uploaded patch fixes things for you?
--
assignee: -> brett.cannon
keywords: +patch
Added file: http://bugs.python.org/file34416/frozen_file.diff
___
Pyt
Changes by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<http://bugs.python.org/issue20935>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Yes it can. I do my Python work typically on Fridays so I will get to it then.
--
___
Python tracker
<http://bugs.python.org/issue20
Changes by Brett Cannon :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20967>
___
___
Python-bugs-list mailing list
Unsubscrib
Brett Cannon added the comment:
This isn't a bug so closing as invalid. As suggested on python-dev, ask on
python-list or python-help for assistance.
--
nosy: +brett.cannon
resolution: -> invalid
status: open -> closed
___
Python tra
Changes by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<http://bugs.python.org/issue20986>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
So the `hg commit -l` bit is going to run afoul of the same group of people who
didn't like my commit message reuse idea unless you explicitly try to make it
very clear that e.g. the first line is for Misc/NEWS and the latter is for the
commit. Otherwi
Brett Cannon added the comment:
You lose chronology in the directory, but not necessarily in the output; if you
sort based on first commit time then you retain the chronological ordering in
the merge.
--
___
Python tracker
<http://bugs.python.
New submission from Brett Cannon:
E.g. with pip included it makes setting up coverage.py easier.
--
assignee: brett.cannon
messages: 214371
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: Update devinabox for Python 3.4
Changes by Brett Cannon :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue19165>
___
___
Python-bugs-list
Changes by Brett Cannon :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20884>
___
___
Python-bugs-list
Brett Cannon added the comment:
Thanks for the patch!
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Brett Cannon :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue21008>
___
___
Python-bugs-list
New submission from Brett Cannon:
Probably the most complicated bit now for using devinabox is building the
various bits of docs in a way that doesn't require mucking with the system
python:
* Having Python built
* Creating a venv
* Installing sphinx
* Running the requisite Makefile wit
Brett Cannon added the comment:
Here is a patch to change PyImport_ImportFrozenModuleObject() to not set
__file__. Had to refactor some things as PyImport_ExecCodeModuleObject() was
setting __file__ no matter what, so to avoid it even being used during import I
had to change some things
Brett Cannon added the comment:
Did you want to update your patch for Python 3.4 and 3.5, Meador?
--
versions: +Python 3.5 -Python 3.3
___
Python tracker
<http://bugs.python.org/issue16
Brett Cannon added the comment:
New patch that includes docs and integrates the tests. If someone who
understands import can look it over and give me an LGTM that would be
appreciated.
--
Added file: http://bugs.python.org/file34556/lazy_loader.diff
Brett Cannon added the comment:
Here is a new patch that addresses Eric's comments and also fills in some holes
that I realized I had while fixing things up. PTAL.
--
Added file: http://bugs.python.org/file34575/lazy_loader.diff
___
Python tr
Changes by Brett Cannon :
Removed file: http://bugs.python.org/file34575/lazy_loader.diff
___
Python tracker
<http://bugs.python.org/issue17621>
___
___
Python-bugs-list m
Changes by Brett Cannon :
Added file: http://bugs.python.org/file34576/lazy_loader.diff
___
Python tracker
<http://bugs.python.org/issue17621>
___
___
Python-bugs-list m
Brett Cannon added the comment:
Another update to trigger loading on attribute deletions as well as detecting
when an import swapped the module in sys.modules, raising ValueError if
detected since it won't have the affect that's expected (could be convinced to
make that ImportErr
Brett Cannon added the comment:
This might be a shutdown issue. If you print out what module is being imported
at the time of the warning its 'io' and it's only coming up after the script
has exited (you will notice the warnings come up after the traceback is
printed). M
Brett Cannon added the comment:
For those that don't read German, the exception says "The specified module
could not be found".
Anyway, what looks suspicious to me is this line that gets imported by
pywintypes:
# extension module loaded from
'C:\\Python34\\lib\\
Brett Cannon added the comment:
So the import warnings were added for sys.meta_path and sys.path_hooks because
prior to Python 3.3 you could empty out those values and import would continue
to work, but with importlib that stopped being the case. My thinking was that
it would be easier to
New submission from Brett Cannon:
Issue #21049 managed to trigger a huge output of "ImportWarning: sys.meta_path
is empty" because it managed to trigger an import during interpreter shutdown.
The ImportWarning for sys.path_hooks and sys.meta_path were originally added
because before
Brett Cannon added the comment:
I should also say that dropping warnings leaves only a single case of
ImportWarning related to empty directory names (in relation to
Finder.find_module()). Once that can go away that will eliminate all uses of
warnings in importlib and thus won't necess
Brett Cannon added the comment:
Sure, I'm fine with closing this as "Won't Fix" based on the cause being an
edge case and rely on issue #21052 to discuss the value of the ImportWarning.
Thanks for the report, Martin.
--
resolution: -> wont fix
Brett Cannon added the comment:
It's a simple `if not sys.meta_path` check so it doesn't differentiate. But
that's actually a good point about it being None in this case due to the
shutdown; if the check changed to `if sys.meta_path is not None and
len(sys.meta_path) == 0` t
New submission from Brett Cannon:
I'm thinking of:
* pkgutil
* py_compile
* compileall
* modulefinder
* freeze
Should make sure they are (a) doing the right/best thing in the face of
importlib/PEP 302/PEP 420/PEP 451, and (b) if they should be integrated into
importlib somehow in
New submission from Brett Cannon:
E.g. linecache says "This module provides random access to individual lines
from text files." That's a big awkward and could just drop "This module" to
read more easily.
--
assignee: docs@python
components: Documentatio
Brett Cannon added the comment:
OK, so trying to import around the package was definitely why the first
instance didn't work so that's all expected.
As for the failure when importing psycopg2, my guess is that the freezing of
psycopg2.__init__ is not setting __path__ to anything rea
3501 - 3600 of 5934 matches
Mail list logo