Michael Felt added the comment:
Yes, clearly related (maybe even duplicate).
What surprised me is that after I copied ld_so_aix to where it was expected I
still see a premature end with:
Traceback (most recent call last):
File "/var/aixtools/python/Python/2.7.12.0/opt/lib/pyth
New submission from Michael Lee:
This patch updates the section about `Any` in the typing module. Previously,
that section was relatively sparse and didn't seem to do a very good job of
helping the reader understand what the distinction between `Any` and `object`
is.
This patch expands
New submission from Michael Lee:
This patch adds (previously missing) documentation for `typing.Generator`.
--
assignee: docs@python
components: Documentation
files: document-generators.patch
keywords: patch
messages: 272010
nosy: docs@python, gvanrossum, michael0x2a
priority: normal
Michael Lee added the comment:
Here's revision two. The only change I didn't make was the one about the
isinstance check. It isn't included in PEP 484, and after talking to Guido, he
decided it wouldn't be appropriate to document it here.
--
Added file: ht
Michael Lee added the comment:
Revision two -- I added a brief note mentioning that SendType is contravariant,
as Ivan suggested.
--
Added file: http://bugs.python.org/file44026/document-generators-v2.patch
___
Python tracker
<h
Michael Lee added the comment:
Revision 3 -- I changed the protocol for the example so that you stop the
generator by sending in a negative number as a sentinel rather then None.
--
Added file: http://bugs.python.org/file44027/document-generators-v3.patch
New submission from Michael Lee:
This patch documents typing.Text and typing.AnyStr.
I decided against creating a new top-level section to document Text/AnyStr
mainly because it seems like how exactly str/bytes/unicode is handled by mypy
and described in PEP 484 might be changing sometime in
Michael Felt added the comment:
Had some flooding (leaking pipes, rather values) issues to fix. Will
look at this asap.
On 04-Aug-16 10:58, Martin Panter wrote:
> Martin Panter added the comment:
>
> Okay, so to be clear, I am assuming XLC supports all of the following fields,
&
Michael Felt added the comment:
On 02-Aug-16 15:34, Martin Panter wrote:
> Martin Panter added the comment:
>
> For 2.7, adding the automatic RTLD_MEMBER mode does not seem like a bug fix
> to me. Currently, I understand this code could load two separate libraries:
>
> file =
Michael Lee added the comment:
Second revision attached below.
--
Added file: http://bugs.python.org/file44121/document-text-and-anystr-2.patch
___
Python tracker
<http://bugs.python.org/issue27
Michael Felt added the comment:
On 8/4/2016 10:58 AM, Martin Panter wrote:
> Can you figure out a way to test for XLC (but not GCC, which the AIX buildbot
> uses), and then try my patch out? Hopefully you see no more compiler
> warnings, test_ints() should now pass, and test_shorts()
New submission from Michael Büsch:
This adds a whitelist parameter with the name 'unless' to contextlib.suppress,
so one can specify exceptions that will not be suppressed.
This is useful for specifying single sub-exceptions that we still want to
catch, even of we want to suppress
Changes by Michael Büsch :
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue27814>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Büsch added the comment:
>Could you please produce a patch that conforms to PEP-8.
I tried hard to do so. Could you please tell me what parts are not compliant,
so I can fix them?
--
___
Python tracker
<http://bugs.python.org/issu
Michael Büsch added the comment:
Thanks for your comments.
Here's version 2 of the patch.
Changes:
- A typo in the docstring was fixed.
- Space was removed in keyword assignments.
- Documentation was added.
(Note that I signed and sent the contributor agreement. It should arrive
Michael Büsch added the comment:
>and instead point you towards https://bugs.python.org/issue12029
Fair enough.
But how would a 'suppress OSError, but catch FileNotFoundError' look like with
this for example?
(Note that I can't subclass the exception)
>I'm also
Michael Büsch added the comment:
>when particular instances of "catch this exception, but not these ones" become
>common, we tend to *change the standard exception hierarchy* to eliminate them
>(e.g. StopIteration, KeyboardError, GeneratorExit no longer inheriting from
&
Michael Felt added the comment:
The more common TESTED "behavior" issue is simply:
find_library("c") always returns None while it should be returning
either libc.a(shr.o) in 32-bit mode and libc.a(shr_64.o) in 64-bit mode.
If that gets corrected, then adding RTLD_M
Michael Felt added the comment:
I'll get to this asap. Have to install a new "clean" environment aka a
new virtual machine.
On 18-Aug-16 02:43, Martin Panter wrote:
> Martin Panter added the comment:
>
> Michael, byref() is just a helper for passing an object’s ad
Michael Felt added the comment:
On 22-Aug-16 04:04, Martin Panter wrote:
> Martin Panter added the comment:
>
> The ctypes tests all seem to be protected with code that checks for None, and
> explicitly skip the test in that case. The skip message should be visible
> when you
Michael Felt added the comment:
On 22-Aug-16 19:43, Eric N. Vander Weele wrote:
> Eric N. Vander Weele added the comment:
>
> I came across this issue while researching where to post my patch (having
> come across this while building Python 2.7 & 3.x on AIX via xlc).
>
>&
Michael Büsch added the comment:
>an implementation of the vastly *less* common pattern:
Ok, here are some numbers.
My codebase is about 32 kLOC.
$ git grep suppressAllExc |wc -l
20
$ git grep contextlib\\.suppress |wc -l
17
(suppressAllExc being my local version to suppress Exception,
Michael Felt added the comment:
On 23-Aug-16 02:01, Martin Panter wrote:
> Martin Panter added the comment:
Thank you for your reply!
>
> I had understood that changing find_library() would only be useful in
> combination with the automatic RTDL_MEMBER detection.
Adding the RTLD_M
New submission from Michael Felt:
p.s. - guessing on the component - this is after make install
+ make install DESTDIR=/var/aixtools/aixtools/python/3.6.0.164 >
.buildaix/install.out
+ mkinstallp.ksh /var/aixtools/aixtools/python/3.6.0.164 >
.buildaix/mkinstallp.out
+
renamed:./o
New submission from Michael Felt:
FYI: Compiler warnings that appear on stderr (skipping any messages sent to
stdout) - xlc V11 as the reporting compiler.
Two that may need attention are the redefines of _POSIX_C_SOURCE and
_XOPEN_SOURCE in pyconfig.h
Also surprised by the message:
Could not
Michael Felt added the comment:
New patch (diff) - that I hope address the comments made in the previous
submission
--
Added file: http://bugs.python.org/file44205/Python3.6.Lib.ctypes.160823.patch
___
Python tracker
<http://bugs.python.
Michael Felt added the comment:
patch to include RTLD_MEMBER in Modules/_ctypes and also "document", or not
document, RTLD_NOW
--
Added file:
http://bugs.python.org/file44206/Python3.6.Modules._ctypes.160823.patch
___
Python trac
Michael Felt added the comment:
Using:
root@x064:[/data/prj/aixtools/python/tests]cat -n bits.c
1 struct BITS {
2 signed int A: 1, B:2, C:3, D:4, E: 5, F: 6, G: 7, H: 8, I: 9;
3 signed short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7;
4 signed char T: 1, U
Michael Felt added the comment:
On 23-Aug-16 21:23, Michael Felt wrote:
> Michael Felt added the comment:
>
> Using:
>
> root@x064:[/data/prj/aixtools/python/tests]cat -n bits.c
>1 struct BITS {
>2 signed int A: 1, B:2, C:3, D:4, E: 5, F: 6, G: 7, H
Michael Felt added the comment:
On 23-Aug-16 19:02, R. David Murray wrote:
> R. David Murray added the comment:
>
> setuptools is not part of CPython or the standard library, though it is
> currently distributed with CPython via ensurepip. You should report this
> issue to the
New submission from Michael Lee:
This patch adds some documentation for typing.Type[C]. The content itself is
mostly an abbreviated version of the description from PEP 484 -- let me know if
the patch is too terse or needs more examples.
--
assignee: docs@python
components
Michael Felt added the comment:
On 27-Aug-16 09:11, Martin Panter wrote:
> Martin Panter added the comment:
>
> The documentation is in RST format in the Doc/ directory. For basic stuff,
> you can just copy the syntax from existing text, or see e.g.
> <https://docs.p
New submission from Michael Kuhn:
I need to install Python 2.7 in two architectures, but under one file system. I
thus configure:
/home/cellnet/michaelk/SRC/Python-2.7.3> ./configure
--prefix=/home/cellnet/michaelk/biocluster
--exec-prefix=/home/cellnet/michaelk/biocluster -q
When I comp
Michael Kuhn added the comment:
Thanks a lot Ned: you're right, the unexpected path was indeed set in
~/.pydistutils.cfg. So I agree with what has been written in the other issues,
that the installation should detect the clash between the command line
configuration and the configuration
Michael Foord added the comment:
As we're specifying this behaviour in the documentation it would be nice to
test it.
--
stage: patch review -> test needed
___
Python tracker
<http://bugs.python.org
Michael Foord added the comment:
Note that there is nothing stopping you using the mock.ANY and
assert_called_once_with style assert currently. You're making your assert more
clumsy than it needs to be.
With my proposal you could write:
q.tranport.assert_called_once_with(mock.ANY,
Michael Foord added the comment:
Or create a JsonMatcher class that does it for you.
class JsonMatcher(object):
def __init__(self, expected):
self.expected = expected
def __eq__(self, other):
return json.loads(other) == self.expected
q.tranport.assert_called_once_with
Michael Enßlin added the comment:
The issue might very well be strictly related to GNU readline.
I have both successfully reproduced it in a C program:
#include
#include
int main() {
readline("\x1b[31;1mthis is a bold red prompt\x1b[m> ");
}
gcc -lreadline test.c
an
Michael Foord added the comment:
Getting rid of the thread local would be an improvement, and the change to how
expected failures is done sounds good too.
--
___
Python tracker
<http://bugs.python.org/issue16
Michael Foord added the comment:
That's a use case that I'm not very *interested* in supporting personally -
however it may well be a use case that was "designed in" and that others have a
need for (I didn't implement expectedFailure support).
I think expectedFailure
Michael Foord added the comment:
So, if it's not documented behaviour I think it's fine to lose it.
--
___
Python tracker
<http://bugs.python.o
Michael Foord added the comment:
If the consensus is that Python documentation should not include explicit
object inheritance then fine to update mock docs accordingly. The backport docs
will still use it as they are for Python 2 as well
Michael Enßlin added the comment:
Terry, i guess you are right; it is indeed not the job of python to know how
its terminal will print characters; there is a whole lot of issues to consider,
such as terminal unicode support, control characters, ansi escape sequences,
terminal-specific escape
Michael Foord added the comment:
If there are specific suggestions to move functionality from test support to
unittest then they can be evaluated on a case-by-case basis. As a "general
suggestion" I'm closing this issue.
--
resolution: -> rejected
stage: -> comm
Changes by Michael Foord :
--
assignee: -> michael.foord
keywords: +needs review
nosy: +michael.foord
stage: -> patch review
type: -> enhancement
versions: +Python 3.4 -Python 3.3
___
Python tracker
<http://bugs.python.or
New submission from Michael Foord:
inspect.getfullargspec (and potentially getargspec?) could *use*
function.__signature__ if set. This allows functions that lie about their
signature with the new introspection tool (Signature) to still work with older
code.
--
components: Library
Michael Foord added the comment:
PythonNN\Scripts is the "normal" place for Python command line tools to be
installed to. Does the installer not put this on the PATH for windows?
--
nosy: +michael.foord
___
Python tracker
<http://bu
Michael Johnson added the comment:
On input, the reader sees a line like
['one\\\n','element']
from the file iterator and successfully escapes the newline character, but
still interprets the end of the string as the end of a record. I've attached a
patch that m
New submission from Michael Foord:
An iterator set as a mock side_effect should be able to include mock.DEFAULT to
use the standard return value.
def test_side_effect_iterator_default(self):
mock = Mock(return_value=2)
mock.side_effect = [1, DEFAULT]
result = mock
Michael Foord added the comment:
As David says, the current workaround is to provide a mixin (base) class that
inherits from object. Because this doesn't inherit from TestCase there is no
confusion.
We *may* add a class marker that allows you to provide TestCase subclasses that
won
Michael Foord added the comment:
There's a straightforward patch here, it just needs applying:
http://code.google.com/p/mock/issues/attachmentText?id=190&aid=19&name=mock.patch&token=6pDNkNBcNLDftg-PsUE8roPb6T4%3A1363712167613
--
_
Michael Foord added the comment:
Thanks for the report and the patch. Good catch!
It will need looking over as it's not immediately obvious to me it's correct.
In the code that checks the loader path, does it iterate over every member of
the namespace path - even directories that
Michael Foord added the comment:
Issue 11798 is somewhat related.
--
___
Python tracker
<http://bugs.python.org/issue17534>
___
___
Python-bugs-list mailin
Michael Foord added the comment:
Yes this is still relevant and needs doing (and is easy).
The implementation should be similar to:
def patch(self, *args, **kwargs):
# lazy import
from unittest.mock import patch
p = patch(*args, **kwargs)
result = p.start()
self.addCleanup
Michael Foord added the comment:
My preferred fix is to wrap "an exception during import" as a test that fails
instead of an AttributeError. This would definitely be a new feature rather
than a bugfix - so it could only be in 3.4.
It could be made available to Python 2.7 t
Michael Foord added the comment:
For features like test skipping I would prefer to keep all the documentation
together.
--
___
Python tracker
<http://bugs.python.org/issue17
Michael Foord added the comment:
This was committed without NEWS entry or documentation update.
--
___
Python tracker
<http://bugs.python.org/issue17502>
___
___
New submission from Michael Foord:
When patching builtin names (e.g. open) in a specific namespace you need to
specify "create=True" or patch will refuse to create a name that doesn't exist.
patch could whitelist the builtin names, when the patch target is a module
object, to
Michael Foord added the comment:
I don't think that's a particular issue. In general you only need to use
"create=True" if a name is *not* available in a namespace.
Builtin names are odd in that you can use them in a namespace even though they
don't exist there - so
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue3778>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Michael Foord:
>>> from unittest.mock import create_autospec
>>> def f(): pass
...
>>> m = create_autospec(f)
>>> m.side_effect = [1, 2]
>>> m()
Traceback (most recent call last):
File "", line 1, in
File &quo
New submission from michael kearney:
This is not a bug per se, though perhaps documentation rewrite might be
appropriate.
I've been building python for windows for several years now. I have found that
it is unnecessarily problematic. Perhaps my expectations are too high. When I
st
Michael Foord added the comment:
This illustrates the difference:
>>> from mock import Mock, create_autospec
>>> some_list = [1, 2, 3]
>>> m = Mock()
>>> m.side_effect = some_list
>>> m.side_effect
>>> m2 = create_autospec(lambda: None)
&
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue7855>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
I'm afraid I'm inclined to agree with Antoine. This seems a relatively
specialised problem and I'd expect to see it solved in the test system rather
than in unittest itself.
One solution, and something I'd like to see, is a way for test sy
Michael Birtwell added the comment:
Sorry about the delay in the contributor form. Things got in the way then I
completely forgot about it. It's done now.
--
___
Python tracker
<http://bugs.python.org/is
Michael Foord added the comment:
The default test runner is quite horrible.
--
___
Python tracker
<http://bugs.python.org/issue17908>
___
___
Python-bugs-list m
Michael Foord added the comment:
What's the benefit of this change?
--
___
Python tracker
<http://bugs.python.org/issue17974>
___
___
Python-bugs-list m
Michael Foord added the comment:
Ok, feel free to reimplement discovery command line handling if it can be done
in a compatible-but-less-horrible way. Anyway, the patch looks fine and a
couple of minor cleanups in there.
--
___
Python tracker
Michael Foord added the comment:
Test discovery and new options (buffer, failfast etc) were bolted onto an old
and ugly design. Yes the code could use an overhaul and rebuilding from scratch
- but doing that whilst remaining fully compatible with all the existing usage
patterns is "diff
Michael Foord added the comment:
Discovery from a module importing main doesn't make sense (although from a
*script* importing main it does).
So long as "python -m unittest -v" continues to launch discovery, and the
"positional argument" form of discovery still works,
New submission from Michael Fox:
import lzma
count = 0
f = lzma.LZMAFile('bigfile.xz' ,'r')
for line in f:
count += 1
print(count)
Comparing python2 with pyliblzma to python3.3.1 with the new lzma:
m@air:~/q/topaz/parse_datalog$ time python lzmaperf.py
102368
r
Michael Fox added the comment:
3.4 is much better but still 4x slower than 2.7
m@air:~/q/topaz/parse_datalog$ time python2.7 lzmaperf.py
102368
real0m0.053s
user0m0.052s
sys 0m0.000s
m@air:~/q/topaz/parse_datalog$ time
~/tmp/cpython-23836f17e4a2/bin/python3.4 lzmaperf.py
102368
Michael Fox added the comment:
I looked into it a little and it looks like pyliblzma is a pure C
extension whereas new lzma library wraps liblzma but the rest is
python. In particular this happens for every line:
if size < 0:
end = self._buffer.find(b"\
Michael Fox added the comment:
io.BufferedReader works well for me. Thanks for the good suggestion.
Now python 3.3 and 3.4 have similar performance to each other and they
are only 2x slower than pyliblzma.
>From my perspective default wrapping with io.BufferedReader is a great
idea. I ca
Michael Fox added the comment:
I was thinking about this line:
end = self._buffer.find(b"\n", self._buffer_offset) + 1
Might be a bug? For example, is there a unicode where one of several
bytes is '\n'? In this case it splits the line in the middle of a
character, right?
Michael Fox added the comment:
You're right. In fact, what doesn't make sense is to be doing
line-oriented reads on a binary file. Why was I doing that?
I do have another quibble though. The open() function is like this:
open(file, mode='r', buffering=-1, encoding=None,
Michael Fox added the comment:
I thought of an even more hazardous case:
if compression == 'gz':
import gzip
open = gzip.open
elif compression == 'xz':
import lzma
open = lzma.open
else:
pass
On Mon, May 20, 2013 at 9:41 AM, Michael Fox wrote:
>
Michael Fox added the comment:
I thought about it some more and the only bug here is mine, failing to
explicitly set mode='rt'.
Maybe back when someone invented text and binary modes they should
have been clear which was to be the default for all things. Maybe when
someone made the
Michael Foord added the comment:
The patch (including lazy import) looks good, and the test looks ok too. I
still think that patch should be the default instead of patch.object - although
I wouldn't object to a second method (name?) if there was significant d
Michael Foord added the comment:
It just needs committing, I believe Kushal Das has volunteered to do it.
--
___
Python tracker
<http://bugs.python.org/issue21
Michael Foord added the comment:
I assume you mean you get the error *with* 3.5 (not "without"). Does this
happen *every time* (i.e. is it trivially reproducible) - or can you provide a
repro?
This is regression that I would *assume* (a totally lazy assumption) introduced
by the
Michael Foord added the comment:
As _testFunc is a string and shouldn't be, I'd be very interested to know
*what* the string is. That may give us a clue as to where it has come from. (So
a try...except...raise that also prints that value would be a good
New submission from Michael Kuss:
When running the following:
>> json.dump(['name': "港区"], myfile.json, indent=4, separators=(',', ': '),
>> ensure_ascii=False)
the function escapes the unicode, even though I have explicitly asked to not
fo
Michael Ohlrogge added the comment:
This is my first time posting here, so apologies if I'm breaking rules.
I'd like to put in a vote in favor of this patch to get the matching scores.
I am a researcher at Stanford University using this tool to match up about
100,000 differen
Michael Ohlrogge added the comment:
Another way the scores could be useful would be to write an algorithm that
would give you a number of possible answers based on the scores that you get.
In other words, for example, perhaps if one of the possible matches has a score
about .9, then it would
Michael Foord added the comment:
Assertions are not uncommon in setUp. setUp is for setting up common state
shared between tests and I regularly want to assert that state creation /
preconditions are correct.
I've never been bitten by this issue (I rarely use expectedFailure), but
Michael Foord added the comment:
Maybe if the expectedFailure is applied to the whole class and it's the setUp
that is unable to work. I've never seen it used that way of course (mostly
because it doesn't work that way) - but I *
New submission from Michael Cetrulo:
The following warning is being generated when running test case:
Warning -- locale was modified by test___all__
According to the comment there, importing the rlcompleter module changes (or
used to change) the locale so after the import it was being set
Michael Foord added the comment:
Ah. Test discovery is discovering FunctionTestCase and attempting to
instantiate it as a test. And failing.
Maybe discovery should special case that class and not treat it as a normal
TestCase.
--
___
Python
Michael Kuss added the comment:
Pardon the delay - this json dump function is embedded in a much larger script,
so it took some untangling to get it running on Python 3.3, and scrub some
personal identifying info from it. This script also does not work in Python 3.3:
File "C:/Users/
Michael Foord added the comment:
With one minor doc change (break up the really long sentence), this looks good
to go to me.
--
___
Python tracker
<http://bugs.python.org/issue22
Michael Foord added the comment:
I agree.
--
title: unittest discovery is fragile -> Blacklist FunctionTestCase from test
discovery
___
Python tracker
<http://bugs.python.org/issu
Michael Foord added the comment:
Allowing sys.exit() to end the test run was particularly a problem for testing
command line tools, where improper patching / unexpected code paths would
trigger a sys.exit.
If a test framework author wants a way to end the test run I'm happy to provide
Michael Foord added the comment:
The point is that it is easy to have unintentional dependencies between tests.
Test a sets up some state that test b relies on. This means that test b passes,
so long as test a has already run. This is bad, tests should be isolated - it
also means you can
Michael Foord added the comment:
mock in the Python standard library is licensed under the PSF license.
--
___
Python tracker
<http://bugs.python.org/issue22
Michael Foord added the comment:
I agree with Robert that the text output of the default runner should not be
considered a part of the "api" that we make backwards compatible guarantees
about. People who want to customise that should be customising the text
runner/result. (Unfort
Changes by Michael Foord :
--
nosy: +pitrou
___
Python tracker
<http://bugs.python.org/issue22894>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Michael Foord :
--
nosy: -michael.foord
___
Python tracker
<http://bugs.python.org/issue22827>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael Foord added the comment:
One way would be to have an _main.py and have main.py "import *" (or
equivalent) from it. We can't get rid of unittest.main being an alias for
TestProgram - that's been around forever.
--
___
P
2601 - 2700 of 3045 matches
Mail list logo