[issue16806] col_offset is -1 and lineno is wrong for multiline string expressions

2015-02-05 Thread Anthony Sottile
Changes by Anthony Sottile asott...@yelp.com: -- nosy: +asottile ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16806 ___ ___ Python-bugs-list

[issue16806] col_offset is -1 and lineno is wrong for multiline string expressions

2015-02-05 Thread Anthony Sottile
Anthony Sottile added the comment: Any updates on this? I'm running into this as well (still a problem in 3.4) ```$ python3.4 Python 3.4.2 (default, Oct 11 2014, 17:59:27) [GCC 4.4.3] on linux Type help, copyright, credits or license for more information. import ast ast.parse('''foo\n

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: I'm still seeing a very large difference: asottile@work:/tmp$ python repro.py ready module 'city_hoods' from '/tmp/city_hoods.pyc' 72604 VmHWM: 72604 kB VmRSS: 60900 kB asottile@work:/tmp$ rm *.pyc; python repro.py ready module 'city_hoods' from

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: Ah, then 3.4 still has the problem: $ rm -rf __pycache__/ *.pyc; python3.4 repro.py ready module 'city_hoods' from '/tmp/city_hoods.py' 1112892 VmHWM: 1112892 kB VmRSS:127196 kB asottile@work:/tmp$ python3.4 repro.py ready module 'city_hoods' from '/tmp

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: Attached is repro2.py (slightly different so my editor doesn't hate itself when editing the file) I'll attach the other file in another comment since it seems I can only do one at a time -- Added file: http://bugs.python.org/file39257/repro2.py

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: 3.4 seems happier: asottile@work:/tmp$ rm *.pyc; python3.4 repro.py ready module 'city_hoods' from '/tmp/city_hoods.py' 77472 VmHWM: 77472 kB VmRSS: 65228 kB asottile@work:/tmp$ python3.4 repro.py ready module 'city_hoods' from '/tmp/city_hoods.py

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Changes by Anthony Sottile asott...@yelp.com: Added file: http://bugs.python.org/file39259/anon_city_hoods.tar.gz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24085

[issue24085] large memory overhead when pyc is recompiled

2015-04-30 Thread Anthony Sottile
Anthony Sottile added the comment: Adding `import gc; gc.collect()` doesn't change the outcome afaict -- nosy: +asottile ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24085

[issue25815] Improper subprocess output of arguments with braces in them on windows

2015-12-06 Thread Anthony Sottile
Anthony Sottile added the comment: It *is* in my path (otherwise it wouldn't produce any output at all). I'm not trying to use the shell builtin, I'm trying to use the executable. -- resolution: not a bug -> status: closed -> open ___

[issue25815] Improper subprocess output of arguments with braces in them on windows

2015-12-06 Thread Anthony Sottile
Anthony Sottile added the comment: To clarify further, the echo.exe on my path reacts correctly: ``` Anthony@AnthonysDesktop MINGW64 ~/Desktop/git/pre-commit (allow_curly_braces_in_args) $ /usr/bin/echo hi{1} hi{1} Anthony@AnthonysDesktop MINGW64 ~/Desktop/git/pre-commit

[issue25815] Improper subprocess output of arguments with braces in them on windows

2015-12-06 Thread Anthony Sottile
New submission from Anthony Sottile: First some expected output: ``` # from cmd.exe C:\Users\Anthony>echo hi{1} hi{1} # from MINGW $ echo hi{1} hi{1} ``` ``` # On ubuntu $ echo 'hi{1}' hi{1} $ python3.5 -c "import subprocess; print(subprocess.check_output(('echo', 'hi{1}')))&qu

[issue25815] Improper subprocess output of arguments with braces in them on windows

2015-12-06 Thread Anthony Sottile
Anthony Sottile added the comment: ``` C:\Users\Anthony> C:\Users\Anthony\AppData\Local\Programs\Git\usr\bin\echo.exe hi{1} hi1 ``` Must be the provider of echo.exe. I'll take it up with them Sorry for the trouble! -- resolution: -> not a bug status: open -&g

[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Anthony Sottile
Anthony Sottile added the comment: Breaks this function: ``` def rmtree(path): """On windows, rmtree fails for readonly dirs.""" def handle_remove_readonly(func, path, exc): # pragma: no cover (windows) excvalue = exc[1] i

[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Anthony Sottile
Anthony Sottile added the comment: When calling shutil.rmtree on windows on a readonly directory, the error handler is called with os.unlink as the first argument `func` which fails the check `func in (os.rmdir, os.remove)` which succeeded on previous python versions

[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Anthony Sottile
New submission from Anthony Sottile: I've confirmed this bug is present on both windows and linux, the outputs below are from linux however. Compare: ``` $ python3.4 --version Python 3.4.3 $ python3.4 -c 'import os; print(os.unlink == os.remove)' True ``` ``` $ python3.5 --version Python

[issue26704] unittest.mock.patch: Double patching instance method: AttributeError: Mock object has no attribute '__name__'

2016-04-06 Thread Anthony Sottile
Anthony Sottile added the comment: The root cause seems to be that autospecced functions return a function object (not a Mock instance) which a '.mock' attribute which is a MagicMock ( assigned here: https://github.com/python/cpython/blob/ae775ab1eb72f42de2d070158bade4bf261ac04f/Lib/unittest

[issue26704] unittest.mock.patch: Double patching instance method: AttributeError: Mock object has no attribute '__name__'

2016-04-06 Thread Anthony Sottile
New submission from Anthony Sottile: Originally from https://github.com/testing-cabal/mock/issues/350 ## Example ```python from unittest import mock class C(object): def f(self): pass c = C() with mock.patch.object(c, 'f', autospec=True): with mock.patch.object(c, 'f

[issue26704] unittest.mock.patch: Double patching instance method: AttributeError: Mock object has no attribute '__name__'

2016-04-06 Thread Anthony Sottile
Anthony Sottile added the comment: Here's an improved patch which: - passes the tests - puts the test in the correct place I'm not entirely happy with the approach -- open to suggestions :) -- Added file: http://bugs.python.org/file42387/patch2

[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-08 Thread Anthony Sottile
Anthony Sottile added the comment: Oops, broke b'/%80'. Here's a better fix that now takes: (on the wire) b'\x80' -(decode latin1)-> u'\x80' -(encode utf-8)-> b'\xc2\x80' -(decode latin1)-> u'\xc2\x80' to: (on the wire) b'\x80' -(decode latin1)-> u'\x80' -(encode latin1

[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-08 Thread Anthony Sottile
Anthony Sottile added the comment: Forgot to remove the pyver code (leaning a bit too much on pre-commit) -- Added file: http://bugs.python.org/file42405/patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-08 Thread Anthony Sottile
Anthony Sottile added the comment: Updates after review. -- Added file: http://bugs.python.org/file42404/patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-08 Thread Anthony Sottile
New submission from Anthony Sottile: Patch attached with test. In summary: A request to the url b'/\x80' appears to the application as a request to b'\xc2\x80' -- The issue being the latin1 decoded PATH_INFO is re-encoded as UTF-8 and then decoded as latin1 (on the wire) b'\x80' -(decode

[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-08 Thread Anthony Sottile
Anthony Sottile added the comment: A few typos in my previous comment, pressed enter too quickly, here's an updated comment: Patch attached with test. In summary: A request to the url b'/\x80' appears to the application as a request to b'/\xc2\x80' -- The issue being the latin1 decoded

[issue8557] subprocess PATH semantics and portability

2016-03-24 Thread Anthony Sottile
Anthony Sottile added the comment: Here's the workaround I'm opting for: if sys.platform =='win32': distutils.spawn.find_executable(cmd[0]) + cmd[1:] -- nosy: +Anthony Sottile ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue16662] load_tests not invoked in package/__init__.py

2016-04-25 Thread Anthony Sottile
Anthony Sottile added the comment: I have a hunch that this fix here may be causing this: https://github.com/spotify/dh-virtualenv/issues/148 Minimally: echo 'from setuptools import setup; setup(name="demo")' > setup.py echo 'import pytest' > tests/__init__.py $ python setup

[issue26704] unittest.mock.patch: Double patching instance method: AttributeError: Mock object has no attribute '__name__'

2016-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: Seems I've named the patchfile incorrectly -- Hopefully this is correct this time? -- keywords: +patch nosy: +Anthony Sottile Added file: http://bugs.python.org/file42675/2.patch ___ Python tracker <

[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-20 Thread Anthony Sottile
Anthony Sottile added the comment: PEP states that environ variables are str variables decoded using latin1: https://www.python.org/dev/peps/pep-/#id19 Therefore, to get the original bytes, one must encode using latin1 On Apr 20, 2016 3:46 AM, "Александр Эри" <rep...@bu

[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile
Anthony Sottile added the comment: I'm seeing this same failure in python3.5 on 16.04 about 20% of the time: ``` $ python3.5 -m test -v test_dbm == CPython 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] == Linux-4.4.0-57-generic-x86_64-with-Ubuntu-16.04-xenial little-endian

[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile
Anthony Sottile added the comment: Stepping through the code, it seems under ndbm it is creating a file with a '.db' extension: ``` (Pdb) list 47 'g': b'intended', 48 } 49 50 def init_db(self): 51 import pdb; pdb.set_trace() 52

[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile
Anthony Sottile added the comment: That doesn't seem to be the problem though, that occurs in both the successful and failure case -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

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

2017-01-09 Thread Anthony Sottile
Changes by Anthony Sottile <asott...@umich.edu>: -- nosy: +Anthony Sottile ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28700> ___

[issue29258] __init__.py required for pkgutil.walk_packages in python3

2017-01-12 Thread Anthony Sottile
New submission from Anthony Sottile: PEP420 makes __init__.py files optional: https://docs.python.org/3/whatsnew/3.3.html#pep-420-implicit-namespace-packages Though it seems without them, pkgutil.walk_packages does not function as desired: https://docs.python.org/3/library/pkgutil.html

[issue31204] Support __fspath__ in shlex.quote

2017-08-14 Thread Anthony Sottile
New submission from Anthony Sottile: Given shlex.quote often is used closely with calls in `subprocess`, should it also support quoting __fspath__ objects? I'll write up a quick patch for this -- components: Library (Lib) messages: 300270 nosy: Anthony Sottile priority: normal

[issue31204] Support __fspath__ in shlex.quote

2017-08-14 Thread Anthony Sottile
Anthony Sottile added the comment: Ah oops, I'm incorrect here, the __fspath__ object I was dealing with supported __str__ and that's how subprocess was converting it -- not via __fspath__. -- stage: -> resolved status: open -> closed ___

[issue26510] [argparse] Add required argument to add_subparsers

2017-08-14 Thread Anthony Sottile
Anthony Sottile added the comment: I've added a patch for this https://github.com/python/cpython/pull/3027 Would love to get a review so it could be included -- nosy: +Anthony Sottile ___ Python tracker <rep...@bugs.python.org>

[issue9253] argparse: optional subparsers

2017-08-14 Thread Anthony Sottile
Anthony Sottile added the comment: I've attempted to address some of the backward/forward compatibility issue with subparsers becoming optional by default (vs required by default in python2) with this pull request: https://github.com/python/cpython/pull/3027 (would love to get a review

[issue16806] col_offset is -1 and lineno is wrong for multiline string expressions

2017-07-09 Thread Anthony Sottile
Anthony Sottile added the comment: pypy seems to have this right (though I don't know enough about their internals to know if cpython can benefit from their patch) $ venvpypy/bin/pythonPython 2.7.10 (3260adbeba4a, Apr 19 2016, 17:42:20) [PyPy 5.1.0 with GCC 4.8.4] on linux2 Type "

[issue26510] [argparse] Add required argument to add_subparsers

2017-08-08 Thread Anthony Sottile
Changes by Anthony Sottile <asott...@umich.edu>: -- pull_requests: +3061 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26510> ___

[issue30338] LC_ALL=en_US + io.open() => LookupError: (osx)

2017-05-10 Thread Anthony Sottile
New submission from Anthony Sottile: Originally seen here: https://github.com/Microsoft/vscode/issues/26227 ``` $ LC_ALL=en_US python -c 'import io; io.open("/dev/null")' Traceback (most recent call last): File "", line 1, in LookupError: unknown encoding: ``` Admi

[issue31550] Inconsistent error message for TypeError with subscripting

2017-09-21 Thread Anthony Sottile
New submission from Anthony Sottile: There's a bit of history I don't understand and couldn't find the appropriate trail for. The original error message from the 2.6 era: $ python2.6 -c 0[0] Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is unsub

[issue29298] argparse fails with required subparsers, un-named dest, and empty argv

2017-09-20 Thread Anthony Sottile
Changes by Anthony Sottile <asott...@umich.edu>: -- keywords: +patch pull_requests: +3669 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue9253] argparse: optional subparsers

2017-09-15 Thread Anthony Sottile
Anthony Sottile added the comment: My patch mainly addresses the regression pointed out by mike bayer (zzzeek)'s comment. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/

[issue31550] Inconsistent error message for TypeError with subscripting

2017-09-21 Thread Anthony Sottile
Changes by Anthony Sottile <asott...@umich.edu>: -- keywords: +patch pull_requests: +3679 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31550] Inconsistent error message for TypeError with subscripting

2017-09-22 Thread Anthony Sottile
Anthony Sottile added the comment: All I'm really looking for is consistency -- should the change to 2.7 be reverted instead? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/i

[issue31550] Inconsistent error message for TypeError with subscripting

2017-09-24 Thread Anthony Sottile
Anthony Sottile added the comment: Shouldn't you wait for Raymond's arguments before outright closing the PR? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/i

[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-12-15 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: if I'm reading the manpage correctly: `readlink` tells the filename that the symlink points to. lchmod is concerned with setting the `stat` on the link itself (which only some platforms actually s

[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-12-19 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Should this have landed in python3.6? It removes a public symbol `PyExc_RecursionErrorInst` (abi break?) -- nosy: +Anthony Sottile ___ Python tracker <rep...@bugs.python.or

[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-11-03 Thread Anthony Sottile
New submission from Anthony Sottile <asott...@umich.edu>: Fortunately, this can be reproduced with the testsuite: ``` == ERROR: test_copystat_symlinks (__main__.Test

[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-11-03 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Here's one idea for a patch (inspired by the rest of the function): ``` diff --git a/Lib/shutil.py b/Lib/shutil.py index 464ee91..2099289 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -213,6 +213,13 @@ def copystat(sr

[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-11-03 Thread Anthony Sottile
Change by Anthony Sottile <asott...@umich.edu>: -- keywords: +patch pull_requests: +4230 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32277] SystemError via chmod(symlink, ..., follow_symlinks=False)

2017-12-11 Thread Anthony Sottile
Change by Anthony Sottile <asott...@umich.edu>: -- keywords: +patch pull_requests: +4696 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32277] SystemError via chmod(symlink, ..., follow_symlinks=False)

2017-12-11 Thread Anthony Sottile
New submission from Anthony Sottile <asott...@umich.edu>: While investigating https://bugs.python.org/issue31940 I noticed the following is raised as `SystemError` instead of the expected `NotImplementedError` (note: you need a platform with fchmodat but does not support nofollow) ```

[issue32277] SystemError via chmod(symlink, ..., follow_symlinks=False)

2017-12-11 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: I noticed it when I changed the test preconditions in https://github.com/python/cpython/pull/4783 I tried changing a test to trigger this (in this branch) but I found I was just implementing exactly the test in the `skip` condition

[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-12-10 Thread Anthony Sottile
Change by Anthony Sottile <asott...@umich.edu>: -- pull_requests: +4684 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31940> ___

[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-05-15 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: According to the other bugs, the change in 3.3 was an inadvertent regression. The fact that it didn't get fixed for so long is mostly due to the unmaintained state of argparse in the stdlib. The change in behaviour here is the

[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-05-22 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: The bug is orthogonal, you can trigger it without the `required=` keyword argument via the (currently suggested) monkeypatch workaround which restores the pre-3.3 behaviour: import argparse parser = argparse.ArgumentParser(

[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-05-16 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Considering the huge popularity of these SO questions, I don't think this should be reverted: - https://stackoverflow.com/questions/23349349/argparse-with-required-subparser - https://stackoverflow.com/questions/22990977/wh

[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-05-22 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Is there then no pathway for actually fixing the bug? aka how can I get `required=True` to be the default. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-05-22 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: That's a separate issue (also a bug introduced by the bad 3.3 patch): https://bugs.python.org/issue29298 I have an open PR to fix it as well but it has not seen review action: https://github.com/python/cpython/pul

[issue17909] Autodetecting JSON encoding

2018-06-03 Thread Anthony Sottile
Change by Anthony Sottile : -- pull_requests: +6992 ___ Python tracker <https://bugs.python.org/issue17909> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23835] configparser does not convert defaults to strings

2018-07-02 Thread Anthony Sottile
Anthony Sottile added the comment: Unclear if this regression (from this patch) is intentional or not: ``` $ python3.6 -c 'import configparser; configparser.ConfigParser(defaults={"a": None})' $ python3.7 -c 'import configparser; configparser.ConfigParser(defaults={"a"

[issue32539] os.listdir(...) on deep path on windows in python2.7 fails with errno 123

2018-01-12 Thread Anthony Sottile
New submission from Anthony Sottile <asott...@umich.edu>: On windows, a deep path can be accessed by prefixing the path with \\?\ https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255=-2147217396#maxpath The call to `listdir()` fails because it uses a

[issue32539] os.listdir(...) on deep path on windows in python2.7 fails with errno 123

2018-01-12 Thread Anthony Sottile
Change by Anthony Sottile <asott...@umich.edu>: -- keywords: +patch pull_requests: +5023 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue30945] loop.create_server does not detect if the interface is IPv6 enabled

2018-02-09 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Seeing this as well when running the cpython test suite in docker: ``` $ ./python -m test.test_asyncio ... [18 similar traces omitted] ==

[issue30945] loop.create_server does not detect if the interface is IPv6 enabled

2018-02-09 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Actually, my issue seems to be something more strange. The host being passed in is `localhost` which resolves to: ``` >>> pprint.pprint(socket.getaddrinfo('localhost', 80)) [(, , 6, '', ('127.0.0.1', 80)

[issue30945] loop.create_server does not detect if the interface is IPv6 enabled

2018-02-09 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Applying this patch makes the tests pass for me, but I don't think the patch is appropriate (just hides the bug): ``` $ git diff diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py

[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-07-26 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +8005 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue19891> ___ ___ Py

[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-07-26 Thread Anthony Sottile
Anthony Sottile added the comment: I was able to reproduce both the `PermissionError` and the `FileNotFoundError` under these circumstances: $ docker run --user 123:123 -ti python python Python 3.7.0 (default, Jul 17 2018, 11:04:33) [GCC 6.3.0 20170516] on linux Type "help",

[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-03-20 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: The intention of the change in issue 26510 was to pick the least surprising behaviour for the default value of subparsers -- the compatiblity with the behaviour before the regression was introduced in 3.3 was a nice side-

[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-03-20 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Grabbed the wrong SO link, I believe this is the one I meant to link to: https://stackoverflow.com/a/18283730/812183 -- ___ Python tracker <rep...@bugs.python.org> <https://

[issue31550] Inconsistent error message for TypeError with subscripting

2018-03-19 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: I think the main concern here is ease in portability coupled with the incorrectness of the current message (pointed out in https://bugs.python.org/issue31550#msg302738) For instance it was consistent in 2.7.1, but not later on in t

[issue31550] Inconsistent error message for TypeError with subscripting

2018-03-19 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: I made a new PR which instead *reverts* the python2.7 patch to restore consistency -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31550] Inconsistent error message for TypeError with subscripting

2018-03-19 Thread Anthony Sottile
Change by Anthony Sottile <asott...@umich.edu>: -- pull_requests: +5909 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31550> ___

[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-03-20 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Yeah, I picked the default value `True` because I couldn't actually find a user of subparsers that _wanted_ optional subparsers. ¯\_(ツ)_/¯ -- ___ Python tracker <rep...@bugs.python.or

[issue16806] col_offset is -1 and lineno is wrong for multiline string expressions

2018-03-01 Thread Anthony Sottile
Anthony Sottile <asott...@umich.edu> added the comment: Still a problem in 3.7: $ python3.7 Python 3.7.0b2 (default, Feb 28 2018, 06:59:18) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-10-12 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile ___ Python tracker <https://bugs.python.org/issue12782> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35004] Odd behavior when using datetime.timedelta under cProfile

2018-10-16 Thread Anthony Sottile
Anthony Sottile added the comment: Here's a simpler reproduction without involving a third party library: >>> import cProfile >>> from datetime import timedelta >>> pr = cProfile.Profile() >>> timedelta.total_seconds(-25200) Traceback (most recent call las

[issue35001] ImportFrom level cannot be optional

2018-10-16 Thread Anthony Sottile
Anthony Sottile added the comment: Hmmm, I don't think mypy has an annotation for "sometimes has an attribute" -- `Optional[T]` is `Union[T, None]` (why I tried `None`). But you're right, `FromImport` is constructable without a `level` -- it seems to behave as `level=0` (I guess a

[issue35001] ImportFrom level cannot be optional

2018-10-16 Thread Anthony Sottile
Anthony Sottile added the comment: It appears it has always had this bug since introduction of absolute/relative imports in https://github.com/python/cpython/commit/f7f438ba3b05eb4356e7511401686b07d9dfb6d8 Agree with changing this to `# type: int` and correcting the documentation

[issue35001] ImportFrom level cannot be optional

2018-10-16 Thread Anthony Sottile
Anthony Sottile added the comment: In fact, trying to use an `ImportFrom` without an integer `level` results in a `ValueError`: >>> x = ast.parse('from os import path') >>> x.body[0].level = None >>> compile(x, '', 'exec') Traceback (most recent call last): File

[issue16806] col_offset is -1 and lineno is wrong for multiline string expressions

2018-10-20 Thread Anthony Sottile
Change by Anthony Sottile : -- pull_requests: +9361 ___ Python tracker <https://bugs.python.org/issue16806> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-10-21 Thread Anthony Sottile
Anthony Sottile added the comment: This change in behaviour is breaking pycodestyle: https://github.com/PyCQA/pycodestyle/issues/786 Perhaps it shouldn't have been backported (especially all the way to python2.7?) -- nosy: +Anthony Sottile

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-10-21 Thread Anthony Sottile
Anthony Sottile added the comment: I'm surprised this was classified as a bug! Though that's subjective so I get that it's difficult to decide what is and what isn't ¯\(ツ)/¯ -- ___ Python tracker <https://bugs.python.org/issue33

[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Anthony Sottile
Anthony Sottile added the comment: Does this actually make sense for the `os` module? `PWD` is a variable set by your interactive shell and doesn't really make sense outside that context. I expect this function to be too easily confused with `os.getcwd()` and a source of bugs when

[issue34364] problem with traceback for syntax error in f-string

2018-10-28 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +9494 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35137] Exception in isinstance when __class__ property raises

2018-11-01 Thread Anthony Sottile
New submission from Anthony Sottile : This may be intentional, but the behaviour changed between python2 and python3. Want to make sure it's intentional as we're working (hacking) around this in pytest: https://github.com/pytest-dev/pytest/pull/4284 The actual impact on pytest is the use

[issue35137] Exception in isinstance when __class__ property raises

2018-11-01 Thread Anthony Sottile
Anthony Sottile added the comment: arbitrary, sure, but deriving from `Exception` maybe? -- ___ Python tracker <https://bugs.python.org/issue35137> ___ ___ Pytho

[issue33944] Deprecate and remove pth files

2018-10-27 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile ___ Python tracker <https://bugs.python.org/issue33944> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2018-12-31 Thread Anthony Sottile
New submission from Anthony Sottile : This simple program causes a hang / leaked processes (easiest to run in an interactive shell): import multiprocessing tuple(multiprocessing.Pool(4).imap(print, (1, 2, 3))) $ python3.6 Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux

[issue35507] multiprocessing: seg fault when creating RawArray from numpy ctypes

2019-01-19 Thread Anthony Sottile
Anthony Sottile added the comment: yes, please do -- ___ Python tracker <https://bugs.python.org/issue35507> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch pull_requests: +11422, 11423 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +11422 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35802> ___ _

[issue35803] Test and document that `dir=...` in tempfile may be PathLike

2019-01-21 Thread Anthony Sottile
New submission from Anthony Sottile : This appears to be true in 3.6+ -- I'd like to add a test and documentation ensuring that going forward. Related: https://github.com/python/typeshed/issues/2749 -- assignee: docs@python components: Documentation, Tests messages: 334188 nosy

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-21 Thread Anthony Sottile
Anthony Sottile added the comment: looks true for os.chmod as well: https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/clinic/posixmodule.c.h#L327-L328 -- ___ Python tracker <https://bugs.python.org/issue35

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-21 Thread Anthony Sottile
New submission from Anthony Sottile : Unless I'm reading incorrectly: https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/clinic/posixmodule.c.h#L30-L31 https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/clinic

[issue35803] Test and document that `dir=...` in tempfile may be PathLike

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +11424 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35803> ___ _

[issue35803] Test and document that `dir=...` in tempfile may be PathLike

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch pull_requests: +11424, 11425 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35803] Test and document that `dir=...` in tempfile may be PathLike

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch, patch pull_requests: +11424, 11425, 11426 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35766] Merge typed_ast back into CPython

2019-01-19 Thread Anthony Sottile
Anthony Sottile added the comment: > You’d be surprised how tenacious old versions are. heh that's true, at my last job we finally got rid of python2.6 in 2016 :'( anyway -- I don't mean to discourage this, definitely seems valuable to the maintenance of m

[issue35766] Merge typed_ast back into CPython

2019-01-19 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile ___ Python tracker <https://bugs.python.org/issue35766> ___ ___ Python-bugs-list mailing list Unsubscribe:

  1   2   3   4   5   >