[issue32933] mock_open does not support iteration around text files.

2018-07-09 Thread Anthony Flury
Anthony Flury added the comment: But the __next__ is a method on the iterator; So long as __iter__ returns a valid iterator (which it does in my pull request), it will by definition support __next___ Although it is entirely possible that I have misunderstood what you are saying

[issue33336] [imaplib] MOVE is a legal command

2018-07-21 Thread Anthony Singleton
Anthony Singleton added the comment: Fuck you -- components: +Cross-Build, Extension Modules nosy: +Alex.Willmer, Anthony Singleton ___ Python tracker <https://bugs.python.org/issue33

[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",

[issue34352] Using tailf with python3.4

2018-08-07 Thread Anthony Guevara
New submission from Anthony Guevara : When using tailf with Python2.7 there are no issues. When using tailf with Python3.4 some print statements use the old version 2 style. Python3 also complains about an implicit conversion. I have included a patch. -- components: Distutils files

[issue21258] Add __iter__ support for mock_open

2018-09-12 Thread Anthony Flury
Anthony Flury added the comment: The lack of dunder_iter support on mock_open has been resolved in Issue 32933 (Git Hub 5974). Can I suggest that once the above PR is merged into 3.8 (due imminently allegedly ), that we should then backport that fix into 3.5, 3.6 & 3.7 as a minimum ?

[issue32933] mock_open does not support iteration around text files.

2018-09-12 Thread Anthony Flury
Anthony Flury added the comment: Berker, Thanks for your work on getting this complete. I would strongly support backporting if possible. 3.5 and 3.6 will be in common use for a while (afaik 3.6 has only now got delivered to Ubuntu as the default Python 3), and this does fix does allow full

[issue32933] mock_open does not support iteration around text files.

2018-09-14 Thread Anthony Flury
Anthony Flury added the comment: I still support backporting to 3.6 and 3.7 : Yes it is correct that this fix could change the behavior of existing test code, but only if someone has written a test case for a function where : 1. The function under test uses dunder_iter iteration 2. The

[issue32933] mock_open does not support iteration around text files.

2018-09-14 Thread Anthony Flury
Anthony Flury added the comment: Thank you. -- ___ Python tracker <https://bugs.python.org/issue32933> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32153] mock.create_autospec fails if an attribute is a partial function

2018-09-15 Thread Anthony Flury
Anthony Flury added the comment: It seems to me that we have three alternatives : 1. Refuse to create the mock object with a suitable Exception (rather than a crash 2. Copy the object and simply ignore the missing dunder_name (so that funcopy dunder_name is not set 3. Set funcopy

[issue32153] mock.create_autospec fails if an attribute is a partial function

2018-09-16 Thread Anthony Flury
Anthony Flury added the comment: Am not a big fan of special casing, I think the functools.update_wrapper is the way to go - will have a look later and produce a pull request with some test cases. -- ___ Python tracker <https://bugs.python.

[issue34891] Multi-processing example inaccurate warning

2018-10-04 Thread Anthony Flury
New submission from Anthony Flury : On the Multi-processing page <https://docs.python.org/3/library/multiprocessing.html> (just above the reference section) there is a warning that the examples wont work from the interpreter. This is not entirely accurate in that the examples do wo

[issue34891] Multi-processing example inaccurate warning

2018-10-06 Thread Anthony Flury
Anthony Flury added the comment: An example that does work : $ python3 Python 3.6.6 (default, Sep 12 2018, 18:26:19) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or

[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:

[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 (

[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 cal

[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`

[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 So

[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://bug

[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:

[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

[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 whe

[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

[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

[issue35311] exception unpickling error causes `multiprocessing.Pool` to hang forever

2018-11-25 Thread Anthony Sottile
New submission from Anthony Sottile : ``` import multiprocessing class E(Exception): def __init__(self, a1, a2): Exception.__init__(self, '{}{}'.format(a1, a2)) def f(_): raise E(1, 2) multiprocessing.Pool(1).map(f, (1,)) ``` Running this causes a hang: ``` $ py

[issue35311] exception unpickling error causes `multiprocessing.Pool` to hang forever

2018-11-25 Thread Anthony Sottile
Anthony Sottile added the comment: `concurrent.futures` is affected as well: ``` import concurrent.futures class E(Exception): def __init__(self, a1, a2): Exception.__init__(self, '{}{}'.format(a1, a2)) def f(_): raise E(1, 2) with concurrent.futures.ProcessPool

[issue35312] lib2to3.pgen2.parser.ParseError is not roundtrip pickleable

2018-11-25 Thread Anthony Sottile
New submission from Anthony Sottile : related to https://bugs.python.org/issue35311 encountered here: https://gitlab.com/pycqa/flake8/issues/473 minimal reproduction: class TestPickleableException(unittest.TestCase): def test_ParseError(self): err = ParseError('msg', 2

[issue35312] lib2to3.pgen2.parse.ParseError is not roundtrip pickleable

2018-11-25 Thread Anthony Sottile
Change by Anthony Sottile : -- title: lib2to3.pgen2.parser.ParseError is not roundtrip pickleable -> lib2to3.pgen2.parse.ParseError is not roundtrip pickleable ___ Python tracker <https://bugs.python.org/issu

[issue35312] lib2to3.pgen2.parse.ParseError is not roundtrip pickleable

2018-11-25 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +9960 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35312> ___ ___ Py

[issue35328] Set a environment variable for venv prompt

2018-11-27 Thread Anthony Sottile
Anthony Sottile added the comment: The current prompt works fine for me on zsh -- what's the bug here? zsh $ virtualenv venv --prompt '(wat)' Using real prefix '/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7' New python executable in /priva

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

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

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

2018-12-10 Thread Anthony Sottile
Anthony Sottile added the comment: I've opened a PR with the test included: https://github.com/python/cpython/pull/11085 -- ___ Python tracker <https://bugs.python.org/is

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

2018-12-10 Thread Anthony Sottile
Anthony Sottile added the comment: to be honest, I don't recall exactly given it's been 2 and a half years since the original report with no activity. if I recall correctly, this was encountered while upgrading the `mock` backport in yelp's monolithic repository. I want to

[issue17801] Tools/scripts/gprof2html.py: `#! /usr/bin/env python32.3`

2013-04-20 Thread C Anthony Risinger
New submission from C Anthony Risinger: http://hg.python.org/cpython/file/d499189e7758/Tools/scripts/gprof2html.py#l1 ...should be self explanatory. i didn't run into this myself, but i saw that the Archlinux package was fixing it via `sed`, without the customary link to upstream... so

[issue25931] os.fork() command distributed in windows Python27 (in SocketServer module)

2016-04-12 Thread Anthony S Valencia
Changes by Anthony S Valencia : -- nosy: +antvalencia ___ Python tracker <http://bugs.python.org/issue25931> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12485] textwrap.wrap: new argument for more pleasing output

2015-04-13 Thread Gijsbert Anthony van der Linden
Gijsbert Anthony van der Linden added the comment: Updated the patch and added tests. Fixed a problem with the previous patch: result of map function was assumed to be list, however map in Python3 returns an interator. So I replaced it with a list comprehension. -- nosy

<    3   4   5   6   7   8