Changes by Anthony Sottile asott...@yelp.com:
--
nosy: +asottile
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16806
___
___
Python-bugs-list
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
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
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
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
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
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
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
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
___
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 <
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
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
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
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
Changes by Anthony Sottile <asott...@umich.edu>:
--
nosy: +Anthony Sottile
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28700>
___
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
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
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
___
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>
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
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 "
Changes by Anthony Sottile <asott...@umich.edu>:
--
pull_requests: +3061
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26510>
___
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
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
Changes by Anthony Sottile <asott...@umich.edu>:
--
keywords: +patch
pull_requests: +3669
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
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/
Changes by Anthony Sottile <asott...@umich.edu>:
--
keywords: +patch
pull_requests: +3679
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
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
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
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
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
New submission from Anthony Sottile <asott...@umich.edu>:
Fortunately, this can be reproduced with the testsuite:
```
==
ERROR: test_copystat_symlinks (__main__.Test
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
Change by Anthony Sottile <asott...@umich.edu>:
--
keywords: +patch
pull_requests: +4230
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Anthony Sottile <asott...@umich.edu>:
--
keywords: +patch
pull_requests: +4696
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
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)
```
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
Change by Anthony Sottile <asott...@umich.edu>:
--
pull_requests: +4684
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31940>
___
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
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(
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
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
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
Change by Anthony Sottile :
--
pull_requests: +6992
___
Python tracker
<https://bugs.python.org/issue17909>
___
___
Python-bugs-list mailing list
Unsubscribe:
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"
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
Change by Anthony Sottile <asott...@umich.edu>:
--
keywords: +patch
pull_requests: +5023
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
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]
==
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)
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
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +8005
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue19891>
___
___
Py
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",
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-
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://
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
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
Change by Anthony Sottile <asott...@umich.edu>:
--
pull_requests: +5909
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31550>
___
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
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
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue12782>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
Change by Anthony Sottile :
--
pull_requests: +9361
___
Python tracker
<https://bugs.python.org/issue16806>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +9494
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
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
Anthony Sottile added the comment:
arbitrary, sure, but deriving from `Exception` maybe?
--
___
Python tracker
<https://bugs.python.org/issue35137>
___
___
Pytho
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue33944>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Anthony Sottile added the comment:
yes, please do
--
___
Python tracker
<https://bugs.python.org/issue35507>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Anthony Sottile :
--
keywords: +patch, patch
pull_requests: +11422, 11423
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +11422
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35802>
___
_
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
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
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
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +11424
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35803>
___
_
Change by Anthony Sottile :
--
keywords: +patch, patch
pull_requests: +11424, 11425
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
keywords: +patch, patch, patch
pull_requests: +11424, 11425, 11426
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
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
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue35766>
___
___
Python-bugs-list mailing list
Unsubscribe:
1 - 100 of 403 matches
Mail list logo