[issue27632] build on AIX fails when builddir != srcdir, more than bad path to ld_so_aix

2016-08-01 Thread Michael Felt
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

[issue27688] Expand documentation about Any in the typing module

2016-08-04 Thread Michael Lee
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

[issue27689] Add documentation for typing.Generator

2016-08-04 Thread Michael Lee
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

[issue27688] Expand documentation about Any in the typing module

2016-08-05 Thread Michael Lee
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

[issue27689] Add documentation for typing.Generator

2016-08-05 Thread Michael Lee
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

[issue27689] Add documentation for typing.Generator

2016-08-05 Thread Michael Lee
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

[issue27723] Document typing.Text and typing.AnyStr

2016-08-09 Thread Michael Lee
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

[issue27643] test_ctypes fails on AIX with xlc

2016-08-11 Thread Michael Felt
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, &

[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-08-11 Thread Michael Felt
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 =

[issue27723] Document typing.Text and typing.AnyStr

2016-08-15 Thread Michael Lee
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

[issue27643] test_ctypes fails on AIX with xlc

2016-08-16 Thread Michael Felt
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()

[issue27814] contextlib.suppress: Add whitelist argument

2016-08-20 Thread Michael Büsch
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

[issue27814] contextlib.suppress: Add whitelist argument

2016-08-20 Thread Michael Büsch
Changes by Michael Büsch : -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue27814> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27814] contextlib.suppress: Add whitelist argument

2016-08-20 Thread Michael Büsch
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

[issue27814] contextlib.suppress: Add whitelist argument

2016-08-20 Thread Michael Büsch
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

[issue27814] contextlib.suppress: Add whitelist argument

2016-08-20 Thread Michael Büsch
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

[issue27814] contextlib.suppress: Add whitelist argument

2016-08-20 Thread Michael Büsch
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 &

[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-08-21 Thread Michael Felt
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

[issue27643] test_ctypes fails on AIX with xlc

2016-08-21 Thread Michael Felt
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

[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-08-22 Thread Michael Felt
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

[issue27643] test_ctypes fails on AIX with xlc

2016-08-22 Thread Michael Felt
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). > >&

[issue27814] contextlib.suppress: Add whitelist argument

2016-08-22 Thread Michael Büsch
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,

[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-08-23 Thread Michael Felt
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

[issue27843] Spaces in filenames in setuptools

2016-08-23 Thread Michael Felt
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

[issue27844] Python-3.6a4 build messages to stderr (on AIX and xlc compiler)

2016-08-23 Thread Michael Felt
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

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-08-23 Thread Michael Felt
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.

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-08-23 Thread Michael Felt
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

[issue27643] test_ctypes fails on AIX with xlc

2016-08-23 Thread Michael Felt
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

[issue27643] test_ctypes fails on AIX with xlc

2016-08-23 Thread Michael Felt
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

[issue27843] Spaces in filenames in setuptools

2016-08-24 Thread Michael Felt
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

[issue27905] Add documentation for typing.Type

2016-08-30 Thread Michael Lee
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

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-08-30 Thread Michael Felt
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

[issue17235] "make sharedinstall" ignores ./configure settings

2013-02-19 Thread Michael Kuhn
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

[issue17235] "make sharedinstall" ignores ./configure settings

2013-02-20 Thread Michael Kuhn
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

[issue16709] unittest discover order is filesystem specific - hard to reproduce

2013-02-23 Thread Michael Foord
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

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-02-28 Thread Michael Foord
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,

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-02-28 Thread Michael Foord
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

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-02 Thread Michael Enßlin
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

[issue16997] subtests

2013-03-04 Thread Michael Foord
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

[issue16997] subtests

2013-03-04 Thread Michael Foord
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

[issue16997] subtests

2013-03-04 Thread Michael Foord
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

[issue17351] Remove explicit "object" inheritance in Python 3 docs

2013-03-11 Thread Michael Foord
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

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-15 Thread Michael Enßlin
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

[issue8273] move generally useful test.support functions into the unittest package

2013-03-18 Thread Michael Foord
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

[issue17467] Enhancement: give mock_open readline() and readlines() methods

2013-03-19 Thread Michael Foord
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

[issue17481] inspect.getfullargspec could use __signature__

2013-03-19 Thread Michael Foord
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

[issue17480] pyvenv should be installed someplace more obvious on Windows

2013-03-19 Thread Michael Foord
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

[issue15927] csv.reader() does not support escaped newline when quoting=csv.QUOTE_NONE

2013-03-19 Thread Michael Johnson
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

[issue17502] unittest.mock: side_effect iterators ignore DEFAULT

2013-03-20 Thread Michael Foord
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

[issue17519] unittest should not try to run abstract classes

2013-03-22 Thread Michael Foord
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

[issue17502] unittest.mock: side_effect iterators ignore DEFAULT

2013-03-23 Thread Michael Foord
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 -- _

[issue17457] Unittest discover fails with namespace packages and builtin modules

2013-03-23 Thread Michael Foord
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

[issue17534] unittest keeps references to test cases alive

2013-03-25 Thread Michael Foord
Michael Foord added the comment: Issue 11798 is somewhat related. -- ___ Python tracker <http://bugs.python.org/issue17534> ___ ___ Python-bugs-list mailin

[issue11664] Add patch method to unittest.TestCase

2013-03-27 Thread Michael Foord
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

[issue7559] TestLoader.loadTestsFromName swallows import errors

2013-03-27 Thread Michael Foord
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

[issue17329] Document unittest.SkipTest

2013-03-27 Thread Michael Foord
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

[issue17502] unittest.mock: side_effect iterators ignore DEFAULT

2013-04-08 Thread Michael Foord
Michael Foord added the comment: This was committed without NEWS entry or documentation update. -- ___ Python tracker <http://bugs.python.org/issue17502> ___ ___

[issue17660] mock.patch could whitelist builtins to not need create=True

2013-04-08 Thread Michael Foord
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

[issue17660] mock.patch could whitelist builtins to not need create=True

2013-04-08 Thread Michael Foord
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

[issue3778] python uninstaller leave registry entries

2013-04-19 Thread Michael Foord
Changes by Michael Foord : -- nosy: -michael.foord ___ Python tracker <http://bugs.python.org/issue3778> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17826] Setting a side_effect on mock from create_autospec doesn't work

2013-04-24 Thread Michael Foord
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

[issue17846] Building Python on Windows - Supplementary info

2013-04-25 Thread michael kearney
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

[issue17826] Setting a side_effect on mock from create_autospec doesn't work

2013-04-26 Thread Michael Foord
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) &

[issue7855] Add test cases for ctypes/winreg for issues found in IronPython

2013-05-01 Thread Michael Foord
Changes by Michael Foord : -- nosy: -michael.foord ___ Python tracker <http://bugs.python.org/issue7855> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-08 Thread Michael Foord
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

[issue16601] Restarting iteration over tarfile continues from where it left off.

2013-05-09 Thread Michael Birtwell
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

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-09 Thread Michael Foord
Michael Foord added the comment: The default test runner is quite horrible. -- ___ Python tracker <http://bugs.python.org/issue17908> ___ ___ Python-bugs-list m

[issue17974] Migrate unittest to argparse

2013-05-14 Thread Michael Foord
Michael Foord added the comment: What's the benefit of this change? -- ___ Python tracker <http://bugs.python.org/issue17974> ___ ___ Python-bugs-list m

[issue17974] Migrate unittest to argparse

2013-05-14 Thread Michael Foord
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

[issue17974] Migrate unittest to argparse

2013-05-14 Thread Michael Foord
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

[issue17974] Migrate unittest to argparse

2013-05-15 Thread Michael Foord
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,

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-17 Thread Michael Fox
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

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-18 Thread Michael Fox
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

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-18 Thread Michael Fox
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"\

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-19 Thread Michael Fox
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

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-20 Thread Michael Fox
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?

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-20 Thread Michael Fox
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,

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-20 Thread Michael Fox
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: >

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-20 Thread Michael Fox
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

[issue11664] Add patch method to unittest.TestCase

2014-10-12 Thread Michael Foord
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

[issue21600] mock.patch.stopall doesn't work with patch.dict to sys.modules

2014-10-14 Thread Michael Foord
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

[issue22680] unittest discovery is fragile

2014-10-20 Thread Michael Foord
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

[issue22680] unittest discovery is fragile

2014-10-20 Thread Michael Foord
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

[issue22701] Write unescaped unicode characters (Japanese, Chinese, etc) in JSON module when "ensure_ascii=False"

2014-10-22 Thread Michael Kuss
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

[issue21344] save scores or ratios in difflib get_close_matches

2014-10-23 Thread Michael Ohlrogge
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

[issue21344] save scores or ratios in difflib get_close_matches

2014-10-23 Thread Michael Ohlrogge
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

[issue10548] Error in setUp not reported as expectedFailure (unittest)

2014-10-27 Thread Michael Foord
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

[issue10548] Error in setUp not reported as expectedFailure (unittest)

2014-10-27 Thread Michael Foord
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 *

[issue22751] Fix test___all__ warning about modified environment

2014-10-28 Thread Michael Cetrulo
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

[issue22680] unittest discovery is fragile

2014-10-31 Thread Michael Foord
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

[issue22701] Write unescaped unicode characters (Japanese, Chinese, etc) in JSON module when "ensure_ascii=False"

2014-10-31 Thread Michael Kuss
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/

[issue22457] load_tests not invoked in root __init__.py when start=package root

2014-11-04 Thread Michael Foord
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

[issue22680] Blacklist FunctionTestCase from test discovery

2014-11-05 Thread Michael Foord
Michael Foord added the comment: I agree. -- title: unittest discovery is fragile -> Blacklist FunctionTestCase from test discovery ___ Python tracker <http://bugs.python.org/issu

[issue10611] sys.exit() in a test causes a test run to die

2014-11-07 Thread Michael Foord
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

[issue22813] No facility for test randomisation

2014-11-10 Thread Michael Foord
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

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-10 Thread Michael Foord
Michael Foord added the comment: mock in the Python standard library is licensed under the PSF license. -- ___ Python tracker <http://bugs.python.org/issue22

[issue22431] Change format of test runner output

2014-11-10 Thread Michael Foord
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

[issue22894] unittest.TestCase.subTest causes all subsequent tests to be skipped in failfast mode

2014-11-20 Thread Michael Foord
Changes by Michael Foord : -- nosy: +pitrou ___ Python tracker <http://bugs.python.org/issue22894> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-20 Thread Michael Foord
Changes by Michael Foord : -- nosy: -michael.foord ___ Python tracker <http://bugs.python.org/issue22827> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22858] unittest.__init__:main shadows unittest.main

2014-11-20 Thread Michael Foord
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

<    22   23   24   25   26   27   28   29   30   31   >