New submission from Michael Foord :
In Python 3 a metclass can create a class __dict__ that is not a true
dictionary. This can trigger code execution when accessing __dict__ members.
getattr_static should not access them directly but do so using dict methods
directly for dict subclasses and
New submission from Michael Foord :
A version of dir that returns all the members that can be seen by
getattr_static.
--
assignee: michael.foord
components: Library (Lib)
messages: 133017
nosy: michael.foord
priority: low
severity: normal
stage: needs patch
status: open
title
Michael Foord added the comment:
A TestSuite (which is how tests are collected to run) holds all the tests and
therefore keeps them all alive for the duration of the test run. (I presume
this is the issue anyway.)
How would you solve this - by having calling a TestSuite (which is how a test
Michael Foord added the comment:
Not keeping tests alive for the whole run seems like a good thing and either
implementation seems fine to me. I'd be interested to hear if anyone else had
any backwards compatibility concerns though.
--
___
P
Michael Foord added the comment:
Victor's reasons for wanting per-test timeout rather than per-file seem sound.
Need to review the patch to see how much extra complexity it actually
introduces (although on a casual reading the new custom result object it
introduces is trivially simpl
Michael Foord added the comment:
No. It would return all members accessible to getattr_static (which is
completely unrelated to what __dir__ may or may not return). Also calling
__dir__ would mean code execution, and the point of these functions is to avoid
this where possible
Michael Foord added the comment:
Thanks for the patch Andreas. On a quick read through it looks good. I'll do a
proper review shortly.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Michael Foord :
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue11796>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
2.5 / 2.6 are in security fix only mode. So this won't get fixed. Please don't
reopen.
--
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.py
New submission from Michael Gold :
In TarFile.chown, if the lookup
u = pwd.getpwnam(tarinfo.uname)[2]
fails, this line is used:
u = pwd.getpwuid(tarinfo.uid)[2]
This will fail if the uid isn't in /etc/passwd. I think "u = tarinfo.uid"
would make more sense. This fallbac
New submission from Michael Gold :
When I call tar.gettarinfo (where tar is a TarFile instance), the inode
information is inserted into tar.inodes. If I later call tar.gettarinfo on a
linked file, the returned TarInfo will have type LNKTYPE.
I think it's incorrect to store this inform
Michael Gold added the comment:
Actually, TarFile should also have a separate method to take a TarInfo instance
and modify its type to LNKTYPE if applicable. gettarinfo can call that.
This way the user can use a TarInfo object created before any files are added,
and can easily get this
Michael Gold added the comment:
No, I don't have a working implementation. (I basically reimplemented
TarFile.inodes to work around this; I was using TarFile.dereference, so I
already had to do the hard-linking manually.)
--
nosy: +
Michael Gold added the comment:
The tests passed on Linux (with Python 3.2 under fakeroot):
Ran 240 tests in 9.613s
OK
But I don't see any tests that check the uid/gid of extracted files.
--
nosy: +mgold
___
Python tracker
<http://bugs.py
Changes by Michael Foord :
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue11887>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
New patch by Ezio looks good to me. Go ahead and commit. Please raise a
separate issue for error reporting when invalid argument combinations are used.
(i.e. additional keyword arguments but no callable
Michael Foord added the comment:
_baseAssertEqual should not unconditionally catch and ignore all BytesWarnings.
If tests raise warnings/exceptions because they are doing comparisons that
raise warnings/exceptions then those tests should be fixed rather than just
ignoring the warnings
Michael Foord added the comment:
This isn't reproducable (any more?) on Python 2.7, but is on Python 3.2.
Running "python -m unittest package" doesn't find tests in submodules, but
without running full discovery even when passed an explicit module name I don't
Michael Foord added the comment:
Yup, I agree that's pretty sucky. Any suggestions for a fix?
--
___
Python tracker
<http://bugs.python.org/issue12038>
___
___
Changes by Michael Foord :
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue1748064>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
Yep, ensuring the truncated repr includes at least the *first* difference
sounds like the right approach.
--
assignee: -> michael.foord
___
Python tracker
<http://bugs.python.org/issu
Michael Foord added the comment:
If PEP 362 is implemented it would either fix or obsolete this issue:
http://www.python.org/dev/peps/pep-0362/
--
___
Python tracker
<http://bugs.python.org/issue1748
Michael Foord added the comment:
Sorry, *could* fix / obsolete this issue. i.e. builtin functions / methods
could support pep 362 - the reference implementation is in pure python and
doesn't work for C functions.
--
___
Python tracker
New submission from Michael Foord :
>>> import re
>>> re.compile('foo')
<_sre.SRE_Pattern object at 0x1043230>
>>> p = re.compile('foo')
>>> p.__class__
Traceback (most recent call last):
File "", line 1, in
AttributeE
Michael Foord added the comment:
Reworked as a patch, including documentation and NEWS update.
--
keywords: +patch
Added file: http://bugs.python.org/file19669/getattr_static.patch
___
Python tracker
<http://bugs.python.org/issue9
Changes by Michael Foord :
Removed file: http://bugs.python.org/file19669/getattr_static.patch
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bug
Changes by Michael Foord :
--
versions: +Python 2.5 -Python 3.2
Added file: http://bugs.python.org/file19673/getattr_static.patch
___
Python tracker
<http://bugs.python.org/issue9
Michael Foord added the comment:
Committed revision 86566.
--
resolution: -> accepted
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.o
Michael Foord added the comment:
Applied to Python 3.2 in revision 86570.
Python 2.7 will have to be fixed after the next release as we are currently in
release candidate stage.
--
___
Python tracker
<http://bugs.python.org/issue10
New submission from Michael Foord :
"python -m unittest" does nothing useful (runs 0 tests). It would be good to
have it default to discovery, which removes the useless behaviour *and* makes
the default invocation for test discovery shorter.
--
assignee: michael.foord
Michael Foord added the comment:
@Eric
No. "python -m unittest discover ..." will still be needed where you want to
pass arguments to discovery ("python -m unittest ..." still has a different
meaning where you pass arguments). All this will do is give the previously
Michael Foord added the comment:
The test now passes for me on Mac OS X and yes - looks like the same issue as
issue 8447.
--
resolution: -> invalid
stage: needs patch -> committed/rejected
status: open -> closed
___
Python track
Michael Foord added the comment:
Sorry for the late reply. I don't think the patch as provided is sufficient as
it would interfere with people causing unittest.main() directly from a test
module. Checking that TestProgram.loader is None is the way to detect we have
been launched fro
Michael Foord added the comment:
Committed revision 86649.
--
resolution: -> accepted
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Michael Foord added the comment:
Eli - I quite agree. TestProgram is a *particularly* obscure part of unittest.
A much better solution (well - both would be ideal) would be to refactor the
code so that it isn't so obscure.
TestProgram is an artefact of unittest's history and s
New submission from Michael Foord :
Add the unittestgui test runner, built with Tk, to the Tools directory.
It would be good to have this script included in the bin/ directory of the Mac
installer as well.
The unittestgui runner can be found at:
https://bitbucket.org/markroddy
Michael Foord added the comment:
It will need documenting, or at least pointing to in the documentation,
probably with a note recommending Hudson for production use - unittestgui is a
tool for beginners / convenience.
Note also that Brian Curtin has contributed a patch to make unittestgui
Michael Foord added the comment:
Bringing back callable but with a different name is horrible. Just bring it
back for goodness sake.
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue10
Michael Foord added the comment:
Well, Guido has already approved its return - so further debate is relatively
pointless. (Not that that usually stops us...)
--
___
Python tracker
<http://bugs.python.org/issue10
Michael Foord added the comment:
It was on python-ideas in the recent thread about bringing back callable. Feel
free to post a link here for the record.
--
___
Python tracker
<http://bugs.python.org/issue10
New submission from Michael Foord :
As discussed with tarek. It shouldn't be up to distutils2 to decide whether or
not a Python file that has been included in the package should be installed or
not if it is included in the set of files the developer has *asked* to be
installed.
Possibl
Michael Foord added the comment:
I would love this functionality (I almost always initialise defaultdict with a
lambda that just returns a concrete value).
Unfortunately it seems like adding a keyword argument isn't possible because
defaultdict takes arbitrary keyword args (and populate
Michael Foord added the comment:
Well, I was perfectly aware of __missing__ - it's just a three liner to do it
when using a lambda isn't *that* bad... I'm sure the documentation could be
improved to highlight __missing__ though. It's almost always the case that
documenta
New submission from Michael Foord :
This is because jython creates bytecode files with names like
"tests/testwith$py.class". unittest test discovery splits the extension off
__file__ to compare module.__file__ to the expected path.
--
messages: 122467
nosy: michael.foor
Changes by Michael Foord :
--
assignee: -> michael.foord
components: +Library (Lib)
type: -> behavior
versions: +Python 2.7, Python 3.2
___
Python tracker
<http://bugs.python.org/i
Michael Foord added the comment:
Won't need fixing in 3.2. The __pycache__ changes mean that the module.__file__
no longer points to the compiled bytecode file.
--
versions: -Python 3.2
___
Python tracker
<http://bugs.python.org/is
Michael Foord added the comment:
"I'm also thinking that it might be better to include the name of the
deprecated method in the message and use three filters for fail* methods,
assert* methods, and the assert*Regexp* methods that will be deprecated."
That sounds good, w
New submission from Michael Foord :
Reported by Konrad Delong.
class MyTest(unittest.TestCase):
def setUp(self):
raise Exception
@unittest.expectedFailure
def testSomething(self):
assert False, "test method failed"
This code will report error, no
Michael Foord added the comment:
Scanning with Microsoft Security Essentials says "no threat detected".
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.o
Michael Foord added the comment:
We follow engineering which uses j.
(I was about to close this as wontfix but Antoine is particularly keen that
Mark deals with this issue...)
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.
Michael Foord added the comment:
The same is also true for tearDown and cleanUp functions.
--
___
Python tracker
<http://bugs.python.org/issue10548>
___
___
Pytho
Michael Foord added the comment:
FWIW (which isn't much I guess) it annoys me that I have to protect calls to
issubclass with if isinstance(obj, type).
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/is
Michael Foord added the comment:
Note that if an error is raised in a tearDown or cleanUp then
unexpected-success should not be reported either. Not very important but might
as well be fixed at the same time.
--
___
Python tracker
<h
New submission from Michael Foord :
Having tests in Lib/test instead of inside the package makes it easier to grep
the unittest package without grepping the tests. The Windows installer has an
"install without tests" option which is easier to honour if the tests aren't
New submission from Michael Foord :
The unittest documentation, argument names and implementation need to be
consistent about the order of (actual, expected) for TestCase.assert methods
that take two arguments.
This is particularly relevant for the methods that produce 'diffed'
Michael Foord added the comment:
__unittest needs to die (with appropriate deprecation).
I agree that a nicer API for marking functions and methods as needing to be
excluded from unittest stacktraces would be useful. A decorator is a good way
to expose that API to developers. Internally
Michael Foord added the comment:
Raymond - I created a new issue for moving the tests: issue 10572
However, it seems that you are incorrect in saying that Python practise is to
avoid putting tests inside standard library packages. In fact current Python
practise seems to be that where tests
Michael Foord added the comment:
The same is true for 2.7 though, and that is getting bug fixes. svnmerge would
no longer work (and to making the change would mean moving the tests in a point
release).
--
___
Python tracker
<h
Michael Foord added the comment:
That list of examples was non-exhaustive, there is also tkinter.
--
___
Python tracker
<http://bugs.python.org/issue10
New submission from Michael Brooks :
In the attached example is a very simple usage of sgmllib that is trying to
parse:
http://bug>link">
The bug is that sgmllib is parsing this href. Browsers on the other hand see
this as the input's value.
Also keep in mind that escapin
Michael Brooks added the comment:
Oops, I had a misnomer in my bug report.
http://bug>link"> is not escaped and there for the
href should be parsed in this condition but not parsed in the attached
sgmllib_bug.py.
--
___
Python tra
Michael Foord added the comment:
Works for me too. Great!
--
___
Python tracker
<http://bugs.python.org/issue9227>
___
___
Python-bugs-list mailing list
Unsub
Michael Foord added the comment:
Committed revision 86944.
--
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.o
New submission from Michael Foord :
Reported by a unittest2 user.
A SystemExit (or GeneratorExit) will cause a test run to stop in 2.7 / 3.2.
This would just be reported as an error in 2.6.
>>> from unittest import TestCase
>>> def test(s):
... raise GeneratorExit
...
&g
Changes by Michael Foord :
--
title: sys.exit() in a test causes the run to stp -> sys.exit() in a test
causes a test run to die
___
Python tracker
<http://bugs.python.org/issu
New submission from Michael Foord :
It is hard for test infrastructure to halt a test run unless it has access to
the result object.
A StopTestRun exception could be provided. This could be caught in TestCase.run
and call TestResult.stop().
It could be parameterized so that StopTestRun
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue10562>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Michael Foord :
If a test module fails to load during unittest test discovery (SyntaxError or
other exception) then the error is reported during the test run.
Due to the way the exception is re-raised the traceback is lost.
Originally reported as unittest2 issue 29:
https
New submission from Michael Foord :
Feature request against unittest2. Issue 18:
https://code.google.com/p/unittest-ext/issues/detail?id=18
As providing a file path instead of module name to the unittest command line
runner currently fails there is no backwards compatibility issue with making
Michael Foord added the comment:
Committed revision 87003.
--
resolution: -> fixed
stage: -> committed/rejected
___
Python tracker
<http://bugs.python.org/i
Michael Foord added the comment:
(made slightly redundant by Holger's comment but I'll continue anyway)
I think the issue is that setUp / tearDown are used for two different purposes.
The first is setting up and tearing down test infrastructure - where you do
want to see to er
Michael Foord added the comment:
Well, the original report is here:
http://code.google.com/p/unittest-ext/issues/detail?id=21
I copied all the details provided into this issue though. Obviously the
original reporter feels that they have a genuine use case.
There is also issue 9857 where
Michael Foord added the comment:
So from the stackframe you can only get to the code object not to the function
object and although the code object is also reachable from a decorator it isn't
mutable so we can't "mark it" in any way. We could in theory 're-build
Michael Foord added the comment:
Global registry of code objects, hmmm... Could work. I'll prototype it and test
it with IronPython / Jython / pypy.
--
___
Python tracker
<http://bugs.python.org/issu
Michael Foord added the comment:
At the moment exception handling for setUp / tearDown / testMethod and cleanUp
functions are all handled separately. They all have to call addError and as a
result we have inconsistent handling of skips, expected failures (etc). There
are separate issues for
Changes by Michael Foord :
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue2212>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
Presumably not an issue for 3.1/3.2.
(Terry - I assume Sean means the fix is in the bug report comment when he says
'inline'.) A patch and a test would still be nice.
--
versions: +Python 2.7 -Python 2.6
Changes by Michael Foord :
--
versions: +Python 2.6
___
Python tracker
<http://bugs.python.org/issue2212>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Buckley added the comment:
You might want to check out what Django does, as they have the working well.
http://docs.djangoproject.com/en/dev/
--
nosy: +codefisher
___
Python tracker
<http://bugs.python.org/issue8
Michael Foord added the comment:
The argument order doesn't match the name (which isn't a huge deal I don't
think) - but subset in dict does match the element in container order of
assertIn.
--
___
Python tracker
<http
Michael Foord added the comment:
Committed revision 87390.
It is a stretch to see this as a bugfix rather than a new feature so probably
*shouldn't* be backported to 2.7. On the other hand the fix is combined with
the fix for issue 9857 which *is* a bugfix and *should* be backport
Michael Foord added the comment:
Correction, the fix is combined with the fix for issue 10611.
--
___
Python tracker
<http://bugs.python.org/issue9857>
___
___
Michael Foord added the comment:
Committed to Python 2.7 in revision 87406.
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Michael Foord added the comment:
Committed to py3k in revision 87390.
--
___
Python tracker
<http://bugs.python.org/issue10611>
___
___
Python-bugs-list mailin
Michael Foord added the comment:
Improved implementation committed to 2.7 revision 87407. Method name unchanged
there.
--
___
Python tracker
<http://bugs.python.org/issue10
Michael Foord added the comment:
This is committed to 2.7 and 3.2 (using the old name assertItemsEqual in 2.7).
As we're well into the beta cycle I don't think we can change the name in 3.2.
The current failure output is very nice for comparing sequences like [1, 2, 3]
v
New submission from Michael Foord :
sysconfig assumes there will be a makefile if the platform is posix, which
isn't always true. For example IronPython on Mac OS X with mono.
This leads to a traceback on startup with IronPython 2.7:
$ ipy27
Traceback (most recent call last):
File &qu
Michael Foord added the comment:
TextTestRunner is initialised with a stream to output messages on that defaults
to sys.stderr. The correct way to redirect messages is to construct it with a
different stream.
If you want a redirectable stream then construct the runner with a stream that
Michael Foord added the comment:
Actually I can't see a good reason why not to just lookup the *current*
sys.stderr at instantiation time instead of binding at import time as is the
current behaviour.
Patch with tests will make it more likely that this change goes in sooner
rather
Michael Foord added the comment:
No, issue 9878 can't be implemented for Python 2.7 whereas the issues other
implementations have with sysconfig *could* still be resolved in 2.7 as a
bugfix. (Specifically for IronPython on Mac OS X it would mean not assuming
that being on a posix pla
Michael Foord added the comment:
Committed to py3k in revision 87582.
--
___
Python tracker
<http://bugs.python.org/issue10786>
___
___
Python-bugs-list mailin
Michael Foord added the comment:
Thanks Terry. Done. Doc changes committed revision 87679.
--
keywords: -patch
nosy: -MarkRoddy, terry.reedy
resolution: -> accepted
stage: needs patch -> committed/rejected
status: open -> closed
type: feature request -&
Michael Foord added the comment:
I'm fine with this functionality being added in 3.3.
--
___
Python tracker
<http://bugs.python.org/issue10775>
___
___
Pytho
Michael Foord added the comment:
Committed revision 87685.
It would be nice to see this included in the Mac OS X and Windows distribution,
but I guess that applies to the *whole* Tools/ directory.
--
resolution: -> accepted
stage: needs patch -> committed/rejected
status
Michael Foord added the comment:
This doesn't appear to be true on py3k (traceback.format_exc is used to
preserve the original traceback). Need to check on Python 2.7.
--
versions: -Python 3.2
___
Python tracker
<http://bugs.python.org/is
Michael Foord added the comment:
In Python 3.2 assertItemsEqual has been replaced with assertCountEqual that has
a completely different implementation and error format. The implementation and
error output will be backported to the assertItemsEqual method of 2.7 (and to
unittest2).
Error
Michael Foord added the comment:
Same is true of Python 2.7 - looks like an invalid error report.
--
resolution: -> invalid
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Michael Foord :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue10620>
___
___
Python-bugs-list mailing list
Unsubscri
Michael Foord added the comment:
It isn't in __all__ and it is undocumented - so I'd say its private already.
--
___
Python tracker
<http://bugs.python.o
Michael Foord added the comment:
There was a discussion on python-dev about naming conventions in the standard
library. There was no clear consensus that everything non-public should start
with an underscore. Several developers thought that merely being undocumented
or not present in
301 - 400 of 3015 matches
Mail list logo