[issue41601] Performance issue using isspace() in extension module on Windows

2020-08-20 Thread Clemens


New submission from Clemens :

Function isspace() is significantly slower in extension modules in Python 3.7 
or later than in Python 3.6 on Windows 10.

Python 3.6:
>python test.py
Locale: C
Set locale: C
Locale: C
Duration: 0.19718074798583984

Python 3.7:
>python test.py
Locale: C
Set locale: C
Locale: C
Duration: 2.9086477756500244

Python 3.8:
>python test.py
Locale: 
LC_COLLATE=C;LC_CTYPE=English_Germany.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C
Set locale: C
Locale: C
Duration: 2.99224853515625

Python 3.9.0a5:
>python test.py
Locale: 
LC_COLLATE=C;LC_CTYPE=English_Germany.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C
Set locale: C
Locale: C
Duration: 2.90370512008667

Building the extension module:
> python setup.py build_ext

A similar issue already exists, but I am not sure if it is the same problem 
since the suggested solution is about embedding Python rather then extending 
it: https://bugs.python.org/issue35195

--
components: Distutils, Windows
messages: 375722
nosy: Clemens, dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Performance issue using isspace() in extension module on Windows
type: performance
versions: Python 3.7, Python 3.8, Python 3.9

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



[issue41601] Performance issue using isspace() in extension module on Windows

2020-08-20 Thread Clemens


Change by Clemens :


Added file: https://bugs.python.org/file49411/isspace_ext.cpp

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



[issue41601] Performance issue using isspace() in extension module on Windows

2020-08-20 Thread Clemens


Change by Clemens :


Added file: https://bugs.python.org/file49412/setup.py

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



[issue41601] Performance issue using isspace() in extension module on Windows

2020-08-20 Thread Clemens


Change by Clemens :


Added file: https://bugs.python.org/file49413/test.py

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



[issue21367] multiprocessing.JoinableQueue requires new kwarg

2014-04-27 Thread Lee Clemens

New submission from Lee Clemens:

Not mentioned (at least not specifically) in the release notes, 
multiprocessing.JoinableQueue now requires 'ctx' keyword argument:
  def __init__(self, maxsize=0, *, ctx):

This causes an application calling JoinableQueue() to work with 3.3.2 (my 
single test) to work, but not with 3.4.0

TypeError: __init__() missing 1 required keyword-only argument: 'ctx'

The documentation is also incorrect: 
https://docs.python.org/3.4/library/multiprocessing.html#multiprocessing.JoinableQueue

--
components: Interpreter Core
messages: 217289
nosy: [email protected]
priority: normal
severity: normal
status: open
title: multiprocessing.JoinableQueue requires new kwarg
type: compile error
versions: Python 3.4

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



[issue21367] multiprocessing.JoinableQueue requires new kwarg

2014-04-27 Thread Lee Clemens

Lee Clemens added the comment:

Same issue (ctx keyword) occurs with multiprocessing.queues.SimpleQueue

--

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



[issue1208304] urllib2's urlopen() method causes a memory leak

2009-09-04 Thread clemens pecinovsky

clemens pecinovsky  added the comment:

i also ran into the problem of cyclic dependencies. i know if i would
call gc.collect() the problem would be solved, but calling gc.collect()
takes a long time. 

the problem is the cyclic dependency with
r.recv=r.read

i have fixed it localy by wrapping the addinfourl into a new class (i
called it addinfourlFixCyclRef) and overloading the close method, and
within the close method set the recv to none again.

class addinfourlFixCyclRef(addinfourl):
def close(self):
if self.fp is not None and hasattr(self.fp, "_sock"):
self.fp._sock.recv = None
addinfourl.close(self)



r.recv = r.read
fp = socket._fileobject(r, close=True)

resp = addinfourlFixCyclRef(fp, r.msg, req.get_full_url())


and when i call .close() from the response it just works. Unluckily i
had to patch even more in case there is an exception called.
For the whole fix see the attachment

--
nosy: +peci
Added file: http://bugs.python.org/file14827/urllib2.py

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



[issue24942] Remove domain from ipaddress.reverse_pointer property and add method

2015-08-26 Thread Lee Clemens

New submission from Lee Clemens:

To lookup info from Cymru (https://www.team-cymru.org/IP-ASN-mapping.html#dns) 
the domain needs to be changed. Although I have not personally seen any, there 
may also be cases where dropping the domain altogether would be helpful.

So I am wondering if the @property should return the 'bare' reversed address 
and a new function be added to append the version-appropriate domain as the 
default or an optional arg as a convenience?

Ref: https://bugs.python.org/issue20480

--
components: Library (Lib)
messages: 249217
nosy: leeclemens
priority: normal
severity: normal
status: open
title: Remove domain from ipaddress.reverse_pointer property and add method
versions: Python 3.5

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



[issue24942] Remove domain from ipaddress.reverse_pointer property and add method

2015-08-26 Thread Lee Clemens

Changes by Lee Clemens :


--
type:  -> enhancement

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



[issue11691] sqlite3 Cursor.description doesn't set type_code

2011-03-26 Thread William Edward Stuart Clemens

New submission from William Edward Stuart Clemens :

The DB API Spec 2.0 (PEP 249) clearly requires that column name and type_code 
be set as the first two values in Cursor.description the other 5 attributes are 
optional. The sqlite3 module doesn't set type_code.

--
components: None
files: sqlite.patch
keywords: patch
messages: 132289
nosy: wesclemens
priority: normal
severity: normal
status: open
title: sqlite3 Cursor.description doesn't set type_code
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file21421/sqlite.patch

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



[issue11691] sqlite3 Cursor.description doesn't set type_code

2011-03-26 Thread William Edward Stuart Clemens

William Edward Stuart Clemens  added the comment:

The patch for version 3.3 has a one line difference.

--
assignee:  -> docs@python
components: +Documentation, Library (Lib) -None
nosy: +docs@python
versions: +Python 3.3
Added file: http://bugs.python.org/file21422/sqlite3_type_code_py33.diff

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