[issue17445] Handle bytes comparisons in difflib.Differ

2013-03-24 Thread Greg Ward
Greg Ward added the comment: > I recommend the following: replace the simple test in the attached > bytes_diff.py with > Greg's unittest-based tests and adjust the __name__ == '__main__' incantation > accordingly. Latest patch, following Terry's suggestion

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-04-16 Thread Greg Trahair
Changes by Greg Trahair : -- nosy: +Greg.Trahair ___ Python tracker <http://bugs.python.org/issue17204> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-04-16 Thread Greg Trahair
Changes by Greg Trahair : -- nosy: -Greg.Trahair ___ Python tracker <http://bugs.python.org/issue17204> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue734176] Make Tkinter.py's nametowidget work with cloned menu widgets

2013-05-19 Thread Greg Couch
Greg Couch added the comment: We still apply that patch to the Python that we embed in our application and have for the last 10 years :-) -- ___ Python tracker <http://bugs.python.org/issue734

[issue21775] shutil.copytree() crashes copying to VFAT on Linux: AttributeError: 'PermissionError' object has no attribute 'winerror'

2014-11-20 Thread Greg Ward
Greg Ward added the comment: > Would it be possible to write a unit test, maybe using unittest.mock to > mock most parts? Good idea! Turns out this was quite straightforward. The test patch is: --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1,6 +1,7 @@ # Copyright (C

[issue21775] shutil.copytree() crashes copying to VFAT on Linux: AttributeError: 'PermissionError' object has no attribute 'winerror'

2014-11-20 Thread Greg Ward
Greg Ward added the comment: > I'll commit on branch 3.4 and merge to default. Whoops, never mind. Looks like I don't have push permission to hg.python.org after all. It's been 8 years since my last commit, so I shouldn't complain. So... can someone with commit priv

[issue22968] types._calculate_meta nit: isinstance != PyType_IsSubtype

2014-11-29 Thread Greg Turner
New submission from Greg Turner: Kinda trivial but... Something like the enclosed, untested patch would seem to make new_class work a bit more like type_new. To be explicit, the difference is whether or not to respect virtual subclasses. So, for example, as implemented, we can implement

[issue22968] types._calculate_meta nit: isinstance != PyType_IsSubtype

2014-12-02 Thread Greg Turner
Greg Turner added the comment: Also: In types.prepare_class, here is what currently happens: we let x be, in order of preference: (a) the explicitly given type if, one is given, else (b) type(bases[0]), if it exists, else (c) type and then, if isinstance(x, type), we run

[issue22968] types._calculate_meta nit: isinstance != PyType_IsSubtype

2014-12-02 Thread Greg Turner
Greg Turner added the comment: > perhaps "isinstance(x, type)" should have been "issubclass(x, type)" to > correctly capture how python 2 does it. Actually, scratch that -- its a brain fart. IIUC new_class was created because, at the time, there was no exposed turn

[issue22968] Lib/types.py nit: isinstance != PyType_IsSubtype

2014-12-02 Thread Greg Turner
Changes by Greg Turner : -- title: types._calculate_meta nit: isinstance != PyType_IsSubtype -> Lib/types.py nit: isinstance != PyType_IsSubtype ___ Python tracker <http://bugs.python.org/issu

[issue22968] Lib/types.py nit: isinstance != PyType_IsSubtype

2014-12-03 Thread Greg Turner
Greg Turner added the comment: Just added a commit message. -- Added file: http://bugs.python.org/file37349/fix_types_calculate_meta_v3.patch ___ Python tracker <http://bugs.python.org/issue22

[issue22968] Lib/types.py nit: isinstance != PyType_IsSubtype

2014-12-03 Thread Greg Turner
Greg Turner added the comment: Here are some tests for this... first, some tests that pass right now and demonstrate, I think, correctness of the second batch of tests. -- Added file: http://bugs.python.org/file37350/test_virtual_metaclasses.patch

[issue22968] Lib/types.py nit: isinstance != PyType_IsSubtype

2014-12-03 Thread Greg Turner
Greg Turner added the comment: And some analogous tests for types.py, which don't pass without fix_types_calculate_meta_v3.patch. -- Added file: http://bugs.python.org/file37351/test_virtual_metaclasses_in_types_module.patch ___ Python tr

[issue22968] Lib/types.py nit: isinstance != PyType_IsSubtype

2014-12-03 Thread Greg Turner
Greg Turner added the comment: And some analogous tests for types.py, which don't pass without fix_types_calculate_meta_v3.patch. -- Added file: http://bugs.python.org/file37352/test_virtual_metaclasses_in_types_module.patch ___ Python tr

[issue22968] Lib/types.py nit: isinstance != PyType_IsSubtype

2014-12-03 Thread Greg Turner
Greg Turner added the comment: Fixed a trivial typo in test_virtual_metaclass_in_types_module.patch -- versions: +Python 3.5 Added file: http://bugs.python.org/file37356/test_virtual_metaclasses_in_types_module_v2.patch ___ Python tracker <h

[issue23101] \\di\\\\

2014-12-22 Thread Greg Turner
Changes by Greg Turner : -- components: Distutils nosy: dstufft, eric.araujo, gmt priority: normal severity: normal status: open title: \\di ___ Python tracker <http://bugs.python.org/issue23

[issue23101] bleh, sorry, my cat reported this non-bug :)

2014-12-22 Thread Greg Turner
Changes by Greg Turner : -- status: open -> closed title: \\di -> bleh, sorry, my cat reported this non-bug :) ___ Python tracker <http://bugs.python.org/i

[issue23102] distutils: tip-toe around quirks owing to setuptools monkey-patching Extension

2014-12-22 Thread Greg Turner
New submission from Greg Turner: Clinical Presentation: Sometimes a developer consuming distutils will write what seems like a perfectly sensible setup.py, but something inscrutable happens: setup.py bombs out claiming "error: each element of 'ext_modules' option must be an Exte

[issue23102] distutils: isinstance checks fail with setuptools-monkeypatched Extension/Distribution

2014-12-29 Thread Greg Turner
Greg Turner added the comment: Here's the same deal more-or-less for issue 23114... this time I expended considerably less effort verifying that it's not a bad idea. At a glance, though, it looks fine, and solved an instance of the issue 23114 problem I was able to repro on my b

[issue23102] distutils: isinstance checks fail with setuptools-monkeypatched Extension/Distribution

2014-12-29 Thread Greg Turner
Greg Turner added the comment: Perhaps it is worth addressing, briefly, the following hypothetical question, as a litmus test against the faint dis-encapsulation code-smell some folks might be picking up from this: In a hypothetcial world without setuptools, would these changes have merit

[issue26431] string template substitute tests

2016-02-24 Thread Greg McCoy
New submission from Greg McCoy: Wrote test for string template substitute -- components: Tests files: mywork.patch keywords: patch messages: 260837 nosy: Greg McCoy priority: normal severity: normal status: open title: string template substitute tests type: enhancement versions: Python

[issue26431] string template substitute tests

2016-02-25 Thread Greg McCoy
Greg McCoy added the comment: My Mistake, I wasn't running coverage on all the tests -- ___ Python tracker <http://bugs.python.org/issue26431> ___ ___ Pytho

[issue26452] Wrong line number attributed to comprehension expressions

2016-02-27 Thread Greg Price
New submission from Greg Price: In a multi-line list comprehension (or dict or set comprehension), the code for the main expression of the comprehension is wrongly attributed to the *last* line of the comprehension, which might be several lines later. This makes for quite baffling tracebacks

[issue2931] optparse: various problems with unicode and gettext

2015-04-15 Thread Greg Ward
Greg Ward added the comment: > I've turned ash's test program into a bunch of test cases against > Python 3.5 trunk. Is it worth committing them? Yeah, probably. Review comments... +try: +self.parser.error(RUSSIAN_TEXT) +except InterceptedError: +

[issue17445] Handle bytes comparisons in difflib.Differ

2015-04-15 Thread Greg Ward
Greg Ward added the comment: OK I've revived my patch and rebased on latest trunk. http://hg.gerg.ca/cpython/rev/13161c1d9c5f Comments welcome. I'll push this in a couple of days if nobody objects. -- ___ Python tracker <http://bu

[issue17445] Handle bytes comparisons in difflib.Differ

2015-04-16 Thread Greg Ward
Changes by Greg Ward : Added file: http://bugs.python.org/file39083/fa4c6160c518.diff ___ Python tracker <http://bugs.python.org/issue17445> ___ ___ Python-bugs-list m

[issue17445] Handle bytes comparisons in difflib.Differ

2015-04-16 Thread Greg Ward
Greg Ward added the comment: Just uploaded https://bugs.python.org/file39083/fa4c6160c518.diff. Pretty sure I've addressed all of @berker.peksag's review comments: thanks for that! I also fixed a number of subtle bugs in the tests. Pro tip: when asserting that something raises

[issue17445] Handle bytes comparisons in difflib.Differ

2015-04-20 Thread Greg Ward
Changes by Greg Ward : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue17445> ___ ___ Python-bugs-list

[issue23102] distutils: isinstance checks fail with setuptools-monkeypatched Extension/Distribution

2016-09-12 Thread Greg Turner
Greg Turner added the comment: Huzzah -- Added file: http://bugs.python.org/file44619/0001-distutils-type-checks-can-fail-issue-23102.patch ___ Python tracker <http://bugs.python.org/issue23

[issue23102] distutils: isinstance checks fail with setuptools-monkeypatched Extension/Distribution

2016-09-12 Thread Greg Turner
Greg Turner added the comment: Double Huzzah. I can probably cook up a test and even look at those method invocations in considerably less than the existing 1.5-year lifecycle of this bug, but not necessarily immediately due to reasons. -- Added file: http://bugs.python.org

[issue28700] test_dbm failure: KeyError: b'0' (regression in 3.6)

2016-11-15 Thread Greg Ward
New submission from Greg Ward: test_dbm.py fails reliably for me in 3.6, but in 3.5 it passes ~80% of the time. The failure in both cases is KeyError: b'0', which has come up previously in http://bugs.python.org/issue20094 and http://bugs.python.org/issue14120. But since we'v

[issue28700] test_dbm failure: KeyError: b'0' (regression in 3.6)

2016-11-15 Thread Greg Ward
Greg Ward added the comment: Forgot to mention: I'm running: No LSB modules are available. Distributor ID: Ubuntu Description:Ubuntu 16.04.1 LTS Release:16.04 Codename: xenial with $ dpkg-query -W | grep dbm libgdbm3:amd64 1.8.3

[issue28700] test_dbm failure: KeyError: b'0' (regression in 3.6)

2016-11-15 Thread Greg Ward
Greg Ward added the comment: As suggested in http://bugs.python.org/issue14120, I installed libgdbm-dev, re-configured, and re-compiled. That fixes the problem. IMHO that's not good enough: if we're missing a dependency, then either configuring or building should fail. It's nic

[issue28700] test_dbm failure: KeyError: b'0' (intermittent in 3.5, reliable in 3.6)

2016-11-15 Thread Greg Ward
Changes by Greg Ward : -- title: test_dbm failure: KeyError: b'0' (regression in 3.6) -> test_dbm failure: KeyError: b'0' (intermittent in 3.5, reliable in 3.6) ___ Python tracker <http://

[issue28702] Confusing error message when None used in expressions, eg. "'NoneType' object has no attribute 'foo'"

2016-11-15 Thread Greg Ward
New submission from Greg Ward: Python's error message when you let None accidentally sneak into an expression where it doesn't belong could be better. The canonical example is attribute lookup: >>> a = None >>> a.foo Traceback (most recent call last): File &q

[issue28702] Confusing error message when None used in expressions, eg. "'NoneType' object has no attribute 'foo'"

2016-11-15 Thread Greg Ward
Greg Ward added the comment: Based on a brief conversation with Brett Cannon at PyCon Canada the other day. Thanks for the idea, Brett! -- nosy: +brett.cannon ___ Python tracker <http://bugs.python.org/issue28

[issue28702] Confusing error message when None used in expressions, eg. "'NoneType' object has no attribute 'foo'"

2016-11-21 Thread Greg Ward
Greg Ward added the comment: > Is it worth changing about 800 places in CPython code? Not counting > third-party code. Definitely not. My aim is not to fix every possible reference to "instance of 'NoneType'", just the handful of cases that are most frequently enco

<    1   2   3   4