Michael Olson added the comment:
I wrapped the offending assertion in a if main_name != '__main__'. I considered
not checking the module_name against built-in modules but that seemed likely to
be the sort of thing being guarded against, so I left it at an exception for
__main__.
Michael Olson added the comment:
Sorry about that, yes, this is on Windows XP and 7, 32 bit.
And with the if statement it seems to work fine.
v/r
-- Michael Olson
--
___
Python tracker
<http://bugs.python.org/issue10
Michael Olson added the comment:
Ummm, I think I've been unclear on where I was making changes, I changed
lib\multiprocessing\forking.py to fix the issue.
Patch attached.
--
keywords: +patch
resolution: invalid ->
status: closed -> open
Added file: http://bugs.python.or
Michael Olson added the comment:
As a note, I didn't attach a patch at first because I was fairly sure I was
kludging it into submission, but at least this makes it clear as to what I did.
v/r
-- Michael Olson
--
___
Python tracker
Michael Foord added the comment:
Although this is still a real issue for other users of unittest. If I get time
to think about it properly I may reopen.
--
___
Python tracker
<http://bugs.python.org/issue10
Michael Foord added the comment:
I intend to.
--
___
Python tracker
<http://bugs.python.org/issue7911>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Michael Foord :
--
assignee: rhettinger -> michael.foord
___
Python tracker
<http://bugs.python.org/issue10242>
___
___
Python-bugs-list mai
Michael Foord added the comment:
As this has been released in 2.7 (and unittest2) I don't think it can be just
removed in 3.2 - it would make porting code from Python 2 to 3 more painful.
Very happy for you to fix in Python 2.7. Please let me know when it goes in so
that I can keep unit
Michael Foord added the comment:
David - would you get a good approximation of what you want simply with:
self.assertEqual(ascii(first), ascii(second))
(This actually returns "b'first'" "b'second'" so you may want a convenience
function that chops
Michael Foord added the comment:
In general *none* of this should be done until there is clear consensus on
Python-dev and it isn't clear that this is the case.
* On the deocumenting: barry warsaw objects to public apis that aren't
documented and gregory smith asserts (natch) th
Michael Foord added the comment:
+1
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue10278>
___
___
Python-bugs-list mailing list
Unsub
Michael Foord added the comment:
Committed to py3k in revision 86101. Needs porting to Python 2.7 (and
unittest2).
--
___
Python tracker
<http://bugs.python.org/issue9
Michael Foord added the comment:
Committed to release27-maint in revision 86104.
--
resolution: -> accepted
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.o
Michael Foord added the comment:
On Python-dev Nick Coghlan suggests a fix for the fast-path that would allow us
to keep it whilst fixing this bug (not tested yet but adding this note not to
lose it). The issue of the name of this method is in 10273.
Looking at assertItemsEqual, I'
Michael Foord added the comment:
@Ezio
Good catch. Even though several of us (including myself) prefer assertRegex
over assertRegexp it is probably better to have consistent APIs otherwise
people will never remember which methods have the 'p' and w
Michael Foord added the comment:
assertElementCountEqual is good name and I like your implementation suggestion.
I'll put this in. I think the implementation fix can go into 2.7 as well but
not the rename/aliasing.
--
___
Python tracker
Michael Foord added the comment:
Renaming and aliasing methods has a cost. It confuses users of the old names
(including future users - the current API is now baked into django 1.3 unless I
can get an update done in time for them to change the version they're using).
People wh
Changes by Michael Foord :
Removed file: http://bugs.python.org/file18699/static.py
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list mailin
Changes by Michael Foord :
Removed file: http://bugs.python.org/file18701/test_static.py
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list m
Michael Foord added the comment:
Updated implementation that handles instances with inherited __slots__ members
and attributes from C descriptors correctly.
I think is both "good enough" and useful enough to add to inspect. (The
remaining constraints are rare or pa
Changes by Michael Foord :
Added file: http://bugs.python.org/file19484/test_static.py
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list m
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue6058>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Michael Foord :
Removed file: http://bugs.python.org/file19483/static.py
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list mailin
Changes by Michael Foord :
Removed file: http://bugs.python.org/file19484/test_static.py
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list m
Michael Foord added the comment:
Further updated implementation. Now handles data descriptors correctly but
removes the code that resolves the builtin descriptors (calling __get__ on slot
and attribute descriptors).
As it was resolving some descriptors but not all, and resolving getset
Changes by Michael Foord :
Added file: http://bugs.python.org/file19490/test_static.py
___
Python tracker
<http://bugs.python.org/issue9732>
___
___
Python-bugs-list m
New submission from Michael Foord :
In Python 2.7 a change was introduced to TestCase which involves storing a
dictionary of method objects on TestCase instances. This makes them
unpickleable.
unittest2 stores strings (method names) instead of method objects (a fix to
make TestCase instances
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue10228>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
It's fixed in release31-maint as well.
--
___
Python tracker
<http://bugs.python.org/issue10353>
___
___
Python-bugs-list m
Changes by Michael Foord :
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue10360>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Michael Hoffman :
If you create a Pdb instance with an stdin argument, the default behavior is
for commands to be retrieved using raw_input(), which uses sys.stdin instead,
thereby causing the stdin argument to be without effect.
You can work around this by setting the
Changes by Michael Hoffman :
Added file: http://bugs.python.org/file19581/expected_behavior.py
___
Python tracker
<http://bugs.python.org/issue10396>
___
___
Python-bug
Changes by Michael Hoffman :
--
nosy: +hoffman
___
Python tracker
<http://bugs.python.org/issue2571>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Hoffman added the comment:
As always, it seems a bit more complicated than I originally expected. Since
it's too late for a Python 2.x feature addition, I'll wait until I upgrade to
3.x to work on that.
You are correct, technically this is not a docs bug but I think the
Michael Foord added the comment:
The issue is with a non-ascii character in a *Unicode* docstring. Python has to
encode the string to write it to the terminal; the encode is implicit and so
fails.
The problem doesn't happen with Python 3 unless you run on an ascii ter
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue7900>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Michael Hughes :
We use the Python interpreter embedded in our application, and would prefer to
not block an exit of our application waiting for non-daemon threads to finish.
I would like a mechanism exposed that queries for whether or not to wait.
--
components
Michael Hughes added the comment:
I have a patch here.
It is to allow for a callback to be set on the main thread which gets called
when there are non-daemon threads still alive on exit.
The callback returns True or False indicating whether or not it wants to block.
By default, the whole
Changes by Michael Hughes :
Removed file: http://bugs.python.org/file19625/threadingchange.patch
___
Python tracker
<http://bugs.python.org/issue10444>
___
___
Python-bug
Michael Hughes added the comment:
Scratch that last patch. It was missing part of the fix.
I've removed the old patch now, and submitted the proper one.
--
Added file: http://bugs.python.org/file19626/real.patch
___
Python tracker
Michael Hughes added the comment:
To use the callback, you can do this:
import threading
def threadendcallback():
# return False to indicate that we don't
# want to wait for any threads before exiting
return False
threading.currentThread().waitForThreadsOnExitFunc = threadendcal
Michael Foord added the comment:
Sounds like a good change to the docs. Care to provide a patch?
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue11
Michael Foord added the comment:
Thanks blokely, looks good. Needs applying to 2.7 / 3.2 and 3.3 branches.
--
___
Python tracker
<http://bugs.python.org/issue11
Michael Foord added the comment:
Hey, blokeley the same patch will apply cleanly against 3.2 / 3.3 so no worries.
--
___
Python tracker
<http://bugs.python.org/issue11
Michael Foord added the comment:
And also issue 10764. This issue affects alternative implementations of Python.
--
nosy: +michael.foord
___
Python tracker
<http://bugs.python.org/issue9
Michael Foord added the comment:
Actually I think these methods are going back in and staying deprecated, so
hold off for a bit.
--
___
Python tracker
<http://bugs.python.org/issue11
Changes by Michael Foord :
--
assignee: docs@python -> michael.foord
___
Python tracker
<http://bugs.python.org/issue11282>
___
___
Python-bugs-list mai
Michael Foord added the comment:
No, tests as top level modules work fine too. Importability is the only
requirement. (Projects themselves are not typically packages but contain
packages - so the wording needs to change slightly but I like the rest
Michael Foord added the comment:
Except the former is incorrect as the responsibility for printing results as
they occur is with the TestResult and not the runner. I'll look at this and
improve the docs for the runner.
(And yes unittest.main() creates and uses a runner under the hood.
Michael Foord added the comment:
If the verbosity parameter isn't sufficient (which needs documenting but that
is issue 11385) then it would need to be a feature request on DocFileSuite
(part of doctest).
--
___
Python tracker
Michael Foord added the comment:
TextTestRunner was more meant to be an *example* of a test runner. It just
turned out to be the only one and widely used.
--
___
Python tracker
<http://bugs.python.org/issue11
New submission from Michael Foord :
If you call TestCase.run without an argument it will create a default
TestResult and use it to execute the test. It should return the result so that
you can introspect it.
--
assignee: michael.foord
messages: 130120
nosy: michael.foord
priority
Michael Foord added the comment:
Anatoly, does the verbosity parameter work for you? If not then any feature
request / change needs to be for the DocFileSuite as the information is coming
from there rather than unittest itself.
--
assignee: docs@python ->
versions: +Python
Michael Foord added the comment:
Sounds good to me.
--
___
Python tracker
<http://bugs.python.org/issue11298>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Michael Foord :
It is valid in CPython to create a new type with non-string keys in the dict.
This is a problem for other implementations (neither pypy nor jython support
it).
This should raise a warning.
--
components: Interpreter Core
messages: 130462
nosy
Michael Foord added the comment:
Note that other implementations not supporting this has been agreed by Guido.
The language spec says that the class dict is a namespace and should have
string keys.
--
___
Python tracker
<http://bugs.python.
Michael Foord added the comment:
Those methods should *not* have been removed. I thought we had discussed this.
It is my fault for allowing the error in the 3.2 docs to remain.
--
___
Python tracker
<http://bugs.python.org/issue11
New submission from Michael Henry :
test_email_codecs.py in the email module should be ported to Python 3.
The attached patch ports test_email_codecs.py and hooks it into the email test
suite.
--
components: Library (Lib)
files: port-test_email_codecs.py.patch
keywords: patch
messages
New submission from Michael Henry :
The function email.Message.as_string has an out-of-date comment:
"""
This is a convenience method and may not generate the message exactly
as you intend because by default it mangles lines that begin with
"From ". For more fle
New submission from Michael Henry :
In email.Message.get_payload, there is the following out-of-date comment:
"""
# payload can be bytes here, (I wonder if that is actually a bug?)
"""
The code can actually handle bytes payloads.
--
components: Libra
New submission from Michael Henry :
The attached test program, test_email_attach_to_string.py, demonstrates the
desire for email.message.Message.attach to raise a more helpful exception when
the user incorrectly invokes attach() after setting the payload to a string.
--
components
Changes by Michael Foord :
Removed file:
http://bugs.python.org/file21125/test_posixpath_with_same_device.patch
___
Python tracker
<http://bugs.python.org/issue11
Changes by Michael Foord :
Removed file: http://bugs.python.org/file21124/test_posixpath.patch
___
Python tracker
<http://bugs.python.org/issue11503>
___
___
Python-bug
Changes by Michael Foord :
Removed file: http://bugs.python.org/file21122/test_posixpath.patch
___
Python tracker
<http://bugs.python.org/issue11503>
___
___
Python-bug
Michael Foord added the comment:
The patch includes an unconditional "import posix" that will fail on Windows.
posixpath is available on windows (although not *all* its functionality makes
sense), so the whole test should not be skipped - but it is reasonable to skip
just the new t
Michael Foord added the comment:
Note that instead of try finally constructs you can create a cleanup function
and call self.addCleanup(...). This reduces extra levels of indentation in your
test code.
In the new code in "test_ismount", from "# Non-existent mountpoint" on
Michael Foord added the comment:
Scratch the comment about symlink - in test_mount. I see you already protect
that code with "if support.can_symlink()".
--
___
Python tracker
<http://bugs.python.o
Michael Foord added the comment:
Will posixpath.sameopenfile work on Windows? That may need skipping.
--
___
Python tracker
<http://bugs.python.org/issue11
Changes by Michael Foord :
--
assignee: -> michael.foord
___
Python tracker
<http://bugs.python.org/issue10775>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Michael Foord :
--
assignee: docs@python -> michael.foord
___
Python tracker
<http://bugs.python.org/issue11385>
___
___
Python-bugs-list mai
Michael Foord added the comment:
Thanks Daniel (and sorry Andreas). Benjamin Peterson has fixed this.
--
___
Python tracker
<http://bugs.python.org/issue11
New submission from Michael Henry :
The timeit.py module has no specific tests. The attached patch adds
Lib/test/test_timeit.py for unit testing, along with slight modifications
to timeit.py to support predictable unit testing.
--
components: Library (Lib)
files: timeit_unit_test.patch
Michael Henry added the comment:
Issue #11578 added unit tests for timeit.py. Because of this bug, two tests
were omitted. In the attached patch are the previously withheld unit tests
and an alternate method of fixing the bug (developed before Tim's fix was
noticed). It's not c
Michael Henry added the comment:
Issue #5633 contains two additional unit tests that can't be added until
that ticket's bug is fixed.
--
nosy: +rhettinger
resolution: accepted ->
status: closed -> open
___
Python tracker
<htt
Michael Foord added the comment:
I need to check that the implementation has been backported to 2.7 completely /
correctly. Raymond made some changes (output format and a bugfix) that may not
have been backported yet.
--
___
Python tracker
<h
Michael Foord added the comment:
Fixes backported to assertItemsEqual in 2.7.
--
resolution: -> fixed
stage: -> committed/rejected
___
Python tracker
<http://bugs.python.org/i
Changes by Michael Foord :
--
versions: +Python 3.2, Python 3.3
___
Python tracker
<http://bugs.python.org/issue10979>
___
___
Python-bugs-list mailing list
Unsub
Michael Foord added the comment:
Thanks for finding this Brandon. The same problem probably exists for
setupmodule and the teardown variants too.
The issue is that the sys.stdout manipulation is done by result.startTest but
setUpClass and setUpModule are executed by the suite outside the
Michael Foord added the comment:
Does Brian's patch still need applying? (Can this be closed?)
--
___
Python tracker
<http://bugs.python.org/issue10535>
___
___
New submission from Michael Henry :
The attached patch includes additional unit tests for the email module,
and splits pre-existing test_header_encode() and test_decode() functions
into individual test functions.
--
components: Library (Lib)
files: test_email_additional_tests.patch
New submission from Michael Henry :
The attached patch adds unit tests and some minor fixes for the email
module's quoprimime.py file. The header_encode() function did not
properly return an empty string when given an empty string. The
decode() function did not properly detect the
New submission from Michael Henry :
The email module's body_encode() function (found in
quoprimime.py) can generate oversized encoded lines that exceed
the maximum line length specified by the maxlinelen parameter.
The attached test case
'test_encode_trailing_space_at_maxlinelen
Michael Hughes added the comment:
Hey guys
We don't always have control over all of the threads launched within our
application. We might have inexperienced users writing basic scripts using
threads, but they don't know enough about setting them to Daemon. Previous
versions of
New submission from Michael Foord :
Python 3.2 (r32:88452, Feb 20 2011, 10:19:59)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(Exception):
... def _
Michael Foord added the comment:
Personally I don't think this should be valid at all (it should ideally be an
error at the raise point). It is the kind of thing that causes difficulties for
the other implementations trying to match CPython behaviour (this code works in
Python 2.7 - yo
Michael Foord added the comment:
This:
raise type('',(Exception,),{'__new__':lambda *a:object()})
Segfaults 3.2 but not 3.1.
--
___
Python tracker
<http://bug
Michael Foord added the comment:
The former sounds like fixing the bug, the latter like removing functionality.
So yes, I prefer the former...
--
___
Python tracker
<http://bugs.python.org/issue11
Michael Henry added the comment:
David,
Your patch looks fine to me. I like putting the logic is a
separate class as you've done. I looked in itertools for
something to perform the job of the each_last() generator I'd
had in my patch, but I didn't see anything. I l
Michael Hudson added the comment:
To be clear, I have no idea why the patch for issue 960406 removed the continue
from my_fgets. It may have been simply a mistake.
--
___
Python tracker
<http://bugs.python.org/issue11
Michael Foord added the comment:
I'm strongly with Antoine on this. If you use context manager as a decorator
you should be able to reuse it - and in general both generators and context
managers can be reused and so I don't understand the phrase 'moral equivalent
of the i
Michael Foord added the comment:
I'd like to ponder this a bit. Note that the patch is incorrect - fetching the
attribute should not be done with getattr (this will trigger descriptors
instead of fetching the underlying member) and should not be reset
unconditionally (if the origina
Michael Foord added the comment:
Going into multiple directories on the path would make discovery more complex
(but isn't out of the question).
To be compatible with nose test discovery it is likely that we will special
case an "src" directory anyway though (as it is a re
Changes by Michael Foord :
--
versions: +Python 3.3 -Python 3.2
___
Python tracker
<http://bugs.python.org/issue11683>
___
___
Python-bugs-list mailing list
Unsub
Michael Foord added the comment:
Discover does recurse into directories - but only packages, so the algorithm
for importing them is trivial. You're suggesting enhancing that to multiple
strategies (checking non package directories to see if they are on the path and
then recursing into
Michael Foord added the comment:
Calvin, note that the modification you suggest is not a *great* complication to
the discovery algorithm (just "some" complication); so I'll consider it.
--
___
Python tracker
<http://bugs.pyt
Michael Foord added the comment:
I agree. copy is a separate protocol and shouldn't be involved here.
--
___
Python tracker
<http://bugs.python.org/is
Michael Foord added the comment:
Right, I helped with the writing of that at PyCon. The patch method would look
very similar. test.support.patch is not something we want to make public (in
that location).
--
___
Python tracker
<h
New submission from Michael O'Rourke :
If you try to difference the attached files with difflib and a html difference
it take 10 minutes or more. In comparison other differencing tools like windiff
and araxis merge will show the diff within a second.
Example code I'm using is:
Changes by Michael Foord :
--
resolution: -> invalid
stage: -> committed/rejected
___
Python tracker
<http://bugs.python.org/issue11759>
___
___
Pyth
New submission from Michael Foord :
>>> s = "x" * (2**29)
>>> case.assertEqual(s + "a", s + "b")
Traceback (most recent call last):
File "", line 1, in
File "/home/antoine/cpython/default/Lib/unittest/case.py", line 643
201 - 300 of 3015 matches
Mail list logo