[issue40573] inspect.iscorutinefunction() returns False for unittest.mock.AsyncMock instances

2020-05-08 Thread Moriyoshi Koizumi


New submission from Moriyoshi Koizumi :

inspect.iscoroutinefunction() returns False for unittest.mock.AsyncMock 
instances while asyncio.iscoroutinefunction() returns True.

```
>>> import unittest.mock
>>> import inspect
>>> import asyncio
>>> inspect.iscoroutinefunction(unittest.mock.AsyncMock())
False
>>> asyncio.iscoroutinefunction(unittest.mock.AsyncMock())
True
```

Confirmed with 3.8.2 and 3.9dev

--
components: Tests
messages: 368497
nosy: moriyoshi
priority: normal
severity: normal
status: open
title: inspect.iscorutinefunction() returns False for unittest.mock.AsyncMock 
instances
type: behavior
versions: Python 3.8, Python 3.9

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



[issue15077] Regexp match goes into infinite loop

2012-06-15 Thread Moriyoshi Koizumi

New submission from Moriyoshi Koizumi mozo+pyt...@mozo.jp:

A peculiar pair of a regexp and a target string causes the runtime into an 
infinite loop.  The same expression works with Perl.

--
components: Regular Expressions
files: x.py
messages: 162883
nosy: ezio.melotti, moriyoshi, mrabarnett
priority: normal
severity: normal
status: open
title: Regexp match goes into infinite loop
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file26016/x.py

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



[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-18 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

@r.david.murray

 If MyProp is such a subclass, would
 print Fro.baz.__doc__ print Get a baz in 2.6.2 but raise an error in
 2.6.3/4, or would it print None?

Just let it return None as they were for now.  I completely agree
there's a better fix like delegating the access to __doc__ to the base
class (property class in this specific case).

--

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



[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-16 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

Sorry, I don't quite have an idea on the part these patches reenable
the bug. The script of the first message yields exactly the same result
both with the original 2.6.4 and the patched.  Assuming the weirdness
you referred to is different from 5890, I'd say the workaround
introduced by the original patch to property class didn't correctly
avoid the issue in the first place. I mean the fix should be fixed anyhow.

--

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



[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-11 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

A subclass of property doesn't always have writable __doc__, especially 
what is implemented in C.  This actually causes a problem with 
Boost.Python's StaticProperty.

References:
- http://mail.python.org/pipermail/cplusplus-sig/2009-August/014747.html
- http://lists.boost.org/Archives/boost/2009/10/157512.php
- https://bugs.launchpad.net/ubuntu/+source/boost1.38/+bug/457688

--
nosy: +moriyoshi

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



[issue7139] ElementTree: Incorrect serialization of end-of-line characters in attribute values

2009-11-11 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

@ezio.melotti

Yes, it works flawlessly as for parsing. 

Fixing this would actually break the current behavior, but I believe 
this is how it should work.

It seems #5752 pretty much says the same thing.

@effbot

As specified in 2.11 End-of-Line Handling [2], any variants of EOL 
characters should have been normalized into single #xa before it 
actually gets parsed, so bare #xd characters would never appear as they 
are amongst parsed information items.


[2] http://www.w3.org/TR/xml/#sec-line-ends

--

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



[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-11 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

I created a patch against trunk and 2.6-maint that lets it simply ignore
the error that might happen during PyObject_SetAttrString();

--
Added file: http://bugs.python.org/file15311/issue5890-refix-py2.6.patch

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



[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-11 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

and the other one

--
Added file: http://bugs.python.org/file15312/issue5890-refix-trunk.patch

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



[issue7183] did 2.6.3 regress for some uses of the __doc__ property?

2009-11-11 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

See my comment on issue #5890. I attached a patch to solve the
Boost.Python issue.

--
nosy: +moriyoshi

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



[issue7139] ElementTree: Incorrect serialization of end-of-line characters in attribute values

2009-11-02 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

Looks like a duplicate of #6492

--

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



[issue7139] Incorrect serialization of end-of-line characters in attribute values

2009-10-15 Thread Moriyoshi Koizumi

New submission from Moriyoshi Koizumi mozo+pyt...@mozo.jp:

ElementTree doesn't correctly serialize end-of-line characters (#xa, 
#xd) in attribute values.  Since bare end-of-line characters are 
converted to #x20 by the parser according to the specification [1], such 
characters that are represented as character references in the original 
document must be serialized in the same form.

[1] http://www.w3.org/TR/xml11/#AVNormalize   

### sample code

from xml.etree.ElementTree import ElementTree
from cStringIO import StringIO

# builder = ElementTree(file=StringIO(foo\x0d/foo))
# out = StringIO()
# builder.write(out)
# print out.getvalue()

out = StringIO()
ElementTree(file=StringIO(
'''?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE foo [
!ELEMENT foo (#PCDATA)
!ATTLIST foo attr CDATA 
]
foo attr=   test
#13;test#32; test#10;a  #10;/foo
''')).write(out)
# should be foo attr=   test #13;test  test#10;a  \x0a/foo
print out.getvalue()

out = StringIO()
ElementTree(file=StringIO(
'''?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE foo [
!ELEMENT foo (#PCDATA)
!ATTLIST foo attr NMTOKENS 
]
foo attr=   test
#13;test#32; test#10;a  #10;/foo
''')).write(out)
# should be foo attr=test #13;test test#10;a\x0a/foo
print out.getvalue()

--
components: XML
messages: 94074
nosy: moriyoshi
severity: normal
status: open
title: Incorrect serialization of end-of-line characters in attribute values
type: behavior
versions: Python 2.6

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



[issue7139] ElementTree: Incorrect serialization of end-of-line characters in attribute values

2009-10-15 Thread Moriyoshi Koizumi

Changes by Moriyoshi Koizumi mozo+pyt...@mozo.jp:


--
title: Incorrect serialization of end-of-line characters in attribute values - 
ElementTree: Incorrect serialization of end-of-line characters in attribute 
values

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



[issue7139] ElementTree: Incorrect serialization of end-of-line characters in attribute values

2009-10-15 Thread Moriyoshi Koizumi

Moriyoshi Koizumi mozo+pyt...@mozo.jp added the comment:

Tabs must be converted to character references as well.

--

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