[issue39578] MagicMock specialisation instance can no longer be passed to new MagicMock instance

2020-02-10 Thread Elena Oat


Elena Oat  added the comment:

Here's the example I ran, that indeed fails in Python 3.8 and Python 3.9 (with 
different errors) and works in Python 3.7. 

from unittest.mock import MagicMock


class CustomMock(MagicMock):
def __init__(self):
super().__init__(__something__='something')


mock = CustomMock()
MagicMock(mock)


In Python 3.8 the error is TypeError: __init__() got an unexpected keyword 
argument '_new_parent'. 

In Python 3.9 the error is TypeError: __init__() got an unexpected keyword 
argument 'name'.

--

___
Python tracker 
<https://bugs.python.org/issue39578>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39578] MagicMock specialisation instance can no longer be passed to new MagicMock instance

2020-02-10 Thread Elena Oat


Elena Oat  added the comment:

I am looking at reproducing this and creating a short example of where this 
fails. Will look further into more details of why this doesn't work.

--
nosy: +Elena.Oat

___
Python tracker 
<https://bugs.python.org/issue39578>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39545] await is not supported in f-string in 3.6

2020-02-10 Thread Elena Oat


Change by Elena Oat :


--
pull_requests: +17808
pull_request: https://github.com/python/cpython/pull/18434

___
Python tracker 
<https://bugs.python.org/issue39545>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39545] await is not supported in f-string in 3.6

2020-02-10 Thread Elena Oat


Change by Elena Oat :


--
keywords: +patch
pull_requests: +17807
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18433

___
Python tracker 
<https://bugs.python.org/issue39545>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39545] await is not supported in f-string in 3.6

2020-02-10 Thread Elena Oat


Elena Oat  added the comment:

There was no update on this since 02/04, so I will work on this as I am at the 
PyCascades sprints right now.

--
nosy: +Elena.Oat

___
Python tracker 
<https://bugs.python.org/issue39545>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38669] patch.object should raise another error when first argument is a str

2019-11-03 Thread Elena Oat


Change by Elena Oat :


--
keywords: +patch
pull_requests: +16549
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17034

___
Python tracker 
<https://bugs.python.org/issue38669>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38669] patch.object should raise another error when first argument is a str

2019-11-02 Thread Elena Oat

New submission from Elena Oat :

When using patch.object with first argument as a string, e.g. 
´´patch.object('SomeClass', 'somemethod')´´ this raises ´´AttributeError: 
Something does not have the attribute 'do_something'´´. 
This should instead warn user that the correct type for the first argument is a 
class.

--
components: Tests
messages: 355886
nosy: Elena.Oat
priority: normal
severity: normal
status: open
title: patch.object should raise another error when first argument is a str
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue38669>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33361] readline() + seek() on io.EncodedFile breaks next readline()

2018-04-27 Thread Elena Oat

Elena Oat <oat.el...@gmail.com> added the comment:

I've modified a little your example and it's clearly that the readline moves 
the cursor.

```
from __future__ import print_function

import codecs
import io


def run(stream):
offset = stream.tell()
try:
stream.seek(0)
header_row = stream.readline()
finally:
stream.seek(offset)
print(offset)
print(stream.tell())
print('Got header: %r' % header_row)

if stream.tell() == 0:
print(stream.tell())
print(stream.readline())
print('Skipping the header: %r' % stream.readline())

for index, line in enumerate(stream, start=2):
print('Line %d: %r' % (index, line))


b = io.BytesIO(u'ab\r\ncd\ndef\n'.encode('utf-16-le'))
s = codecs.EncodedFile(b, 'utf-8', 'utf-16-le')
run(s)

```
The first call to readline returns cd instead of ab.

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33361>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33361] readline() + seek() on io.EncodedFile breaks next readline()

2018-04-27 Thread Elena Oat

Elena Oat <oat.el...@gmail.com> added the comment:

For you specific example I get also a weird result. Tried this in Python 2.7.10 
and Python 3.6.0.

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33361>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33361] readline() + seek() on io.EncodedFile breaks next readline()

2018-04-27 Thread Elena Oat

Elena Oat <oat.el...@gmail.com> added the comment:

I've tried this with Python 3.6.0 on OSX 10.13.4

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33361>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33361] readline() + seek() on io.EncodedFile breaks next readline()

2018-04-26 Thread Elena Oat

Elena Oat <oat.el...@gmail.com> added the comment:

I cannot replicate this when the stream is:

In: stream_ex = io.BytesIO(u"abc\ndef\nghi\n".encode("utf-8"))
In: f = codecs.EncodedFile(stream_ex, 'utf-8')

In: run(f)

Out: Got header: b'abc\n'
Skipping the header: b'abc\n'
Line 2: b'def\n'
Line 3: b'ghi\n'

--
nosy: +Elena.Oat

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33361>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22069] TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline

2018-04-26 Thread Elena Oat

Change by Elena Oat <oat.el...@gmail.com>:


--
keywords: +patch
pull_requests: +6305
stage: needs patch -> patch review

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue22069>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22069] TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline

2018-04-26 Thread Elena Oat

Elena Oat <oat.el...@gmail.com> added the comment:

Note that the correct link to the test case is:
https://github.com/python/cpython/blob/master/Lib/test/test_io.py#L2565

--
nosy: +Elena.Oat

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue22069>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24356] venv documentation incorrect / misleading

2018-04-24 Thread Elena Oat

Change by Elena Oat <oat.el...@gmail.com>:


--
keywords: +patch
pull_requests: +6289
stage: needs patch -> patch review

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue24356>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Elena Oat

Change by Elena Oat <oat.el...@gmail.com>:


--
keywords: +patch
pull_requests: +6287
stage: needs patch -> patch review

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33275>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31330] argparse.RawTextHelpFormatter does not maintain lines separated by more than one newline

2017-09-06 Thread Elena Oat

Elena Oat added the comment:

I've created a pull request. Could someone review it please?

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31330>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31330] argparse.RawTextHelpFormatter does not maintain lines separated by more than one newline

2017-09-03 Thread Elena Oat

Changes by Elena Oat <oat.el...@gmail.com>:


--
pull_requests: +3316

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31330>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31330] argparse.RawTextHelpFormatter does not maintain lines separated by more than one newline

2017-09-02 Thread Elena Oat

Elena Oat added the comment:

It maintains *whitespace*, not the new lines. 
I've tested this using whitespaces and I think it keeps them according to the 
original description. See the image attached.

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file47117/Screen Shot 2017-09-02 at 
10.45.48.png

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31330>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31065] Documentation for Popen.poll is unclear

2017-08-27 Thread Elena Oat

Changes by Elena Oat <oat.el...@gmail.com>:


--
pull_requests:  -3258

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31065>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31065] Documentation for Popen.poll is unclear

2017-08-27 Thread Elena Oat

Changes by Elena Oat <oat.el...@gmail.com>:


--
pull_requests: +3258

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31065>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26656] Documentation for re.compile is a bit outdated

2017-08-26 Thread Elena Oat

Elena Oat added the comment:

Added the link to the regular expression objects.

--
keywords: +patch
nosy: +Elena.Oat
Added file: http://bugs.python.org/file47103/issue26656.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26656>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31065] Documentation for Popen.poll is unclear

2017-08-26 Thread Elena Oat

Elena Oat added the comment:

I've added a sentence saying about the explicit return value.

--
keywords: +patch
nosy: +Elena.Oat
Added file: http://bugs.python.org/file47102/issue31065.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31065>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2016-03-20 Thread Elena Oat

Elena Oat added the comment:

I tested the patch and it seems fine. Also ran tests for uuid.py and it they 
passed.

--
nosy: +Elena.Oat

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19164>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26545] os.walk is limited by python's recursion limit

2016-03-20 Thread Elena Oat

Elena Oat added the comment:

I've actually tried to test the recursion limit on my Mac OS X. It seems that I 
cannot create any subdirectories after around 500 subdir depth. I guess it's 
related to the allowed path length (<1024 chars?).

--
nosy: +Elena.Oat

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26545>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18859] README.valgrind should mention --with-valgrind

2016-03-12 Thread Elena Oat

Changes by Elena Oat <oat.el...@gmail.com>:


Added file: http://bugs.python.org/file42147/issue18859.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18859>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18859] README.valgrind should mention --with-valgrind

2016-03-12 Thread Elena Oat

Elena Oat added the comment:

I've combined the patch submitted by Sowmya and also added there clarifications 
from points 1, 2 mentioned by Martin Mokrejs.

--
nosy: +Elena.Oat

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18859>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2016-03-11 Thread Elena Oat

Elena Oat added the comment:

I submitted a patch for documentation changes related to strftime "%Y" 
directive inconsistencies. I am not sure that specifying the OS is correct, 
because I haven't tested the inconsistencies on all Linux PCs, Windows versions 
or OS X. I still left them there though, so let me know what's your opinion on 
it.

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file42136/issue13305.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13305>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24780] unittest assertEqual difference output foiled by newlines

2016-01-17 Thread Elena Oat

Elena Oat added the comment:

The issue is not related only to the caret. In fact, as seen in the below 
output, the issue occurs anytime there's a newline character in the beginning 
or middle of the string to be compared. 

In short, if a newline is present in the string and it's in the beginning or 
middle, a newline character should be put at the end of the string, too. This 
will make the output look sensible. If, however, the newline is not present at 
the end, the output is not really readable (the new line is missing).

As we (me and Manvi B.) understand, the caret appears in the output only when 
the strings are similar enough, i.e. their similarity ratio is high enough. 
Otherwise, compare function doesn't show the carets in places of difference. 
This can also be seen in test case test_trailingnewline_2.

This issue occurs, probably, due to using splitlines method.


==
FAIL: test_notrailingnewline_0 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 8, in test_notrailingnewline_0
self.assertEqual("abcDefehiJkl", "abcdefGhijkl")
AssertionError: 'abcDefehiJkl' != 'abcdefGhijkl'
- abcDefehiJkl
?^  ^  ^
+ abcdefGhijkl
?^  ^  ^


==
FAIL: test_notrailingnewline_1 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 14, in test_notrailingnewline_1
self.assertEqual("a\nbcdf", "a\nbddf")
AssertionError: 'a\nbcdf' != 'a\nbddf'
  a
- bcdf?  ^
+ bddf?  ^


==
FAIL: test_notrailingnewline_2 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 18, in test_notrailingnewline_2
self.assertEqual("a\nbcdf", "a\nbddg")
AssertionError: 'a\nbcdf' != 'a\nbddg'
  a
- bcdf+ bddg

==
FAIL: test_starting_and_ending_newline_0 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 12, in test_starting_and_ending_newline_0
self.assertEqual("\nabcDefehiJkl\n", "\nabcdefGhijkl\n")
AssertionError: '\nabcDefehiJkl\n' != '\nabcdefGhijkl\n'
  
- abcDefehiJkl
?^  ^  ^
+ abcdefGhijkl
?^  ^  ^


==
FAIL: test_startingnewline_0 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 10, in test_startingnewline_0
self.assertEqual("\nabcDefehiJkl", "\nabcdefGhijkl")
AssertionError: '\nabcDefehiJkl' != '\nabcdefGhijkl'
  
- abcDefehiJkl?^  ^  ^
+ abcdefGhijkl?^  ^  ^


==
FAIL: test_trailingnewline_0 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 6, in test_trailingnewline_0
self.assertEqual("abcDefehiJkl\n", "abcdefGhijkl\n")
AssertionError: 'abcDefehiJkl\n' != 'abcdefGhijkl\n'
- abcDefehiJkl
?^  ^  ^
+ abcdefGhijkl
?^  ^  ^


==
FAIL: test_trailingnewline_1 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 16, in test_trailingnewline_1
self.assertEqual("a\nbcdf\n", "a\nbddf\n")
AssertionError: 'a\nbcdf\n' != 'a\nbddf\n'
  a
- bcdf
?  ^
+ bddf
?  ^


==
FAIL: test_trailingnewline_2 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 20, in test_trailingnewline_2
self.assertEqual("a\nbcdf\n", "a\nbddg\n")
AssertionError: 'a\nbcdf\n' != 'a\nbddg\n'
  a
- bcdf
+ bddg


--
Ran 8 tests in 0.007s

FAILED (failures=8)

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file41639/test2.py

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24780>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25986] Collections.deque maxlen: added in 2.6 or 2.7?

2016-01-10 Thread Elena Oat

Elena Oat added the comment:

I checked and 2.6 python has maxlen as a parameter, but not a maxlen attribute. 
The maxlen attribute was added in 2.7.

--
nosy: +Elena.Oat

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25986>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25517] regex howto example in "Lookahead Assertions"

2016-01-10 Thread Elena Oat

Elena Oat added the comment:

Corrected the regular expression and documented why [^.]* is used.

--
keywords: +patch
nosy: +Elena.Oat
Added file: http://bugs.python.org/file41566/issue25517.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25517>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19316] devguide: compiler - wording

2016-01-10 Thread Elena Oat

Elena Oat added the comment:

Here's the patch regenerated for the latest devguide.

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file41568/issue19316.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19316>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26001] Tutorial: write() does not expect string in binary mode

2016-01-09 Thread Elena Oat

Elena Oat added the comment:

Wrapped the lines to 80 chars.

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file41556/issue26001.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26001>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25574] 2.7 incorrectly documents objects hash as equal to id

2016-01-09 Thread Elena Oat

Elena Oat added the comment:

Updated the documentation. Now it says that the hash is derived from id, as it 
says already in Python 3 docs.

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file41552/issue25574.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25574>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19217] Calling assertEquals for moderately long list takes too long

2014-08-06 Thread Elena Oat

Elena Oat added the comment:

Attached is the patch that tries to solve the issue for the strings, tuples, 
lists and dictionaries. Tuples, lists and dictionaries use the same value for 
the threshold. There's a helper method in the tests that is generic to all 
mentioned types. 
This issue was discussed during the Helsinki Python sprint.

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file36292/issue19217-2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19217
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16937] -u (unbuffered I/O) command line option documentation mismatch for sys.stdin

2013-07-06 Thread Elena Oat

Changes by Elena Oat oat.el...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file30804/issue16937.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16937
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14853] test_file.py depends on sys.stdin being unseekable

2013-07-06 Thread Elena Oat

Elena Oat added the comment:

testStdin test is useless, it expects that stdin is always unseekable, but 
since sys.stdin could be any file, i.e. it can be seekable.  

The patch removes the test.

--
keywords: +patch
nosy: +Elena.Oat, pitrou
Added file: http://bugs.python.org/file30828/14853.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14853
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com