[issue32561] Add API to io objects for non-blocking reads/writes

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Ideally we would be able to do buffer-only reads through all the of the 
> different read methods (read, readline, readinto, ...),

Hmm... We already have non-blocking support in BufferedIOReader, except it 
*doesn't work*.  The problem is, the semantics mandated by readline() and even 
buffered read() don't work very well with non-blocking IO (see issue13322).

So my opinion here is that only raw IO objects (FileIO) should have this 
functionality.  People can build their own functionality on top of that (such 
as Tornado or asyncio do with their streams).

--
nosy: +pitrou

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What should be done for PR 5006? Changes of this PR have been minimized for 
easier review. But many interesting things can made after merging it. For 
example simplify 'with'-related opcodes. Or implement static blocks (this will 
make the 'try' statement zero-overhead, make checks in frame.f_lineno setter 
more reliable, and unblock some bytecode optimizations). It would be better to 
have more time before a feature freeze.

--

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Apparently PR 5006 has a conflict. Otherwise, is it ready for review?

--

___
Python tracker 

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



[issue32564] Syntax error on using variable async

2018-01-16 Thread Andrew Olefira

New submission from Andrew Olefira :

In python 3.6 you can use name "async" for variable:
>>> class A:
... async = True
... 
>>> 

but in python 3.7a4 you catch syntax error:
>>> class A:
... async = True
  File "", line 2
async = True
  ^
SyntaxError: invalid syntax
>>>

--
messages: 310045
nosy: Andrew Olefira
priority: normal
severity: normal
status: open
title: Syntax error on using variable async
versions: Python 3.7

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Simplifying "with"-related opcodes (and perhaps "finally" ones) sounds nice.

"try" blocks are already zero-overhead for practical purposes (i.e. I don't 
think I've met any workload where moving a "try" around did improve performance 
significantly).

--

___
Python tracker 

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



[issue32564] Syntax error on using variable async

2018-01-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

See https://docs.python.org/3.7/whatsnew/3.5.html#new-keywords.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32561] Add API to io objects for non-blocking reads/writes

2018-01-16 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Hmm, why did I use "unbuffered" as my term above? That's a very odd name. It's 
like, exactly the opposite of what we actually want. Clearly I did not think 
this through properly. Please pretend I said "buffer-only" instead, thanks.

> So my opinion here is that only raw IO objects (FileIO) should have this 
> functionality.  People can build their own functionality on top of that (such 
> as Tornado or asyncio do with their streams).

I guess I don't object to such functionality, but it would be useless to me 
personally. FileIO doesn't solve any problems I have with stream processing; 
the reason I care about this is for providing an async file I/O API. And all 
the async file IO APIs I know [1][2][3] have the public API of "just like 
regular files, but the blocking methods are async". 99% of the time, that means 
TextWrapper and BufferedStream. So I just don't see any way to get the 
advantages of this feature without either (a) adding buffer-only support to 
those layers, or (b) forking those layers into a 3rd-party library, and then 
adding buffer-only support.

OTOH, it would be ok if in an initial implementation some methods like 
readline() simply always failed when called in buffer-only mode, since this 
would be a best-effort thing. (This is also a different from the non-blocking 
semantics discussion in bpo-13322, which is kind of scary. I don't want to deal 
with partial writes and reads and carrying crucial data in exceptions! I just 
want to know if the operation can trivially be done without blocking, and if 
not then I'll retry it in blocking mode.)

[1] https://github.com/Tinche/aiofiles
[2] 
https://trio.readthedocs.io/en/latest/reference-io.html#asynchronous-filesystem-i-o
[3] https://curio.readthedocs.io/en/latest/reference.html#module-curio.file

--

___
Python tracker 

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



[issue32561] Add API to io objects for non-blocking reads/writes

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> And all the async file IO APIs I know [1][2][3] have the public API of "just 
> like regular files, but the blocking methods are async". 99% of the time, 
> that means TextWrapper and BufferedStream. So I just don't see any way to get 
> the advantages of this feature without either (a) adding buffer-only support 
> to those layers, or (b) forking those layers into a 3rd-party library, and 
> then adding buffer-only support.

Yeah... The concrete problem is that there's already a poorly thought-out 
"non-blocking mode" that only partly works, and suddenly the code (which 
includes a lot of delicate, performance-critical C code... to give you an idea, 
even recently a consistency bug in truncate() was discovered) will have to be 
massaged to support another non-blocking mode of operation.

So that's why I'm very cautious about integrating this into BufferedReader and 
friends.

--

___
Python tracker 

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



[issue32544] Speed up hasattr(o, name) and getattr(o, name, default)

2018-01-16 Thread INADA Naoki

INADA Naoki  added the comment:

I run pyperformance.
It seems django_template is significant faster.

# Without PGO+LTO

./python -m perf compare_to -G --min-speed=2 default.json patched.json
Slower (6):
- scimark_monte_carlo: 217 ms +- 9 ms -> 237 ms +- 10 ms: 1.09x slower (+9%)
- scimark_lu: 326 ms +- 14 ms -> 351 ms +- 20 ms: 1.08x slower (+8%)
- float: 219 ms +- 4 ms -> 226 ms +- 8 ms: 1.03x slower (+3%)
- crypto_pyaes: 208 ms +- 2 ms -> 213 ms +- 2 ms: 1.02x slower (+2%)
- pickle: 20.1 us +- 0.2 us -> 20.6 us +- 0.4 us: 1.02x slower (+2%)
- xml_etree_iterparse: 184 ms +- 3 ms -> 188 ms +- 3 ms: 1.02x slower (+2%)

Faster (10):
- django_template: 315 ms +- 4 ms -> 287 ms +- 3 ms: 1.10x faster (-9%)
- logging_format: 25.9 us +- 0.3 us -> 24.7 us +- 0.3 us: 1.05x faster (-5%)
- logging_simple: 21.6 us +- 0.2 us -> 20.6 us +- 0.4 us: 1.05x faster (-5%)
- sympy_str: 399 ms +- 3 ms -> 381 ms +- 2 ms: 1.05x faster (-5%)
- unpack_sequence: 117 ns +- 6 ns -> 112 ns +- 0 ns: 1.04x faster (-4%)
- sympy_expand: 886 ms +- 7 ms -> 851 ms +- 7 ms: 1.04x faster (-4%)
- regex_effbot: 5.00 ms +- 0.09 ms -> 4.84 ms +- 0.11 ms: 1.03x faster (-3%)
- xml_etree_process: 185 ms +- 3 ms -> 180 ms +- 4 ms: 1.02x faster (-2%)
- nqueens: 215 ms +- 3 ms -> 211 ms +- 3 ms: 1.02x faster (-2%)
- telco: 16.0 ms +- 0.6 ms -> 15.6 ms +- 0.4 ms: 1.02x faster (-2%)

Benchmark hidden because not significant (44)

# With PGO+LTO

$ ./python -m perf compare_to -G --min-speed=2 default-opt.json patched-opt.json
Slower (8):
- xml_etree_process: 179 ms +- 3 ms -> 195 ms +- 3 ms: 1.09x slower (+9%)
- xml_etree_generate: 208 ms +- 5 ms -> 224 ms +- 3 ms: 1.08x slower (+8%)
- xml_etree_iterparse: 190 ms +- 5 ms -> 203 ms +- 3 ms: 1.07x slower (+7%)
- pickle_list: 6.80 us +- 0.30 us -> 7.18 us +- 0.72 us: 1.06x slower (+6%)
- genshi_text: 72.8 ms +- 1.1 ms -> 76.3 ms +- 0.8 ms: 1.05x slower (+5%)
- mako: 32.6 ms +- 0.1 ms -> 34.1 ms +- 0.6 ms: 1.05x slower (+5%)
- unpickle_pure_python: 713 us +- 12 us -> 744 us +- 16 us: 1.04x slower (+4%)
- scimark_sor: 375 ms +- 13 ms -> 383 ms +- 11 ms: 1.02x slower (+2%)

Faster (14):
- django_template: 327 ms +- 3 ms -> 296 ms +- 2 ms: 1.10x faster (-9%)
- scimark_lu: 339 ms +- 20 ms -> 309 ms +- 13 ms: 1.10x faster (-9%)
- sympy_str: 418 ms +- 4 ms -> 387 ms +- 3 ms: 1.08x faster (-7%)
- sympy_expand: 926 ms +- 5 ms -> 860 ms +- 5 ms: 1.08x faster (-7%)
- logging_simple: 22.4 us +- 0.3 us -> 21.0 us +- 0.3 us: 1.07x faster (-6%)
- scimark_fft: 741 ms +- 61 ms -> 697 ms +- 25 ms: 1.06x faster (-6%)
- telco: 17.6 ms +- 0.4 ms -> 16.6 ms +- 0.4 ms: 1.06x faster (-5%)
- logging_format: 26.5 us +- 0.3 us -> 25.3 us +- 0.3 us: 1.05x faster (-5%)
- sqlite_synth: 7.35 us +- 0.16 us -> 7.08 us +- 0.18 us: 1.04x faster (-4%)
- scimark_sparse_mat_mult: 8.83 ms +- 0.42 ms -> 8.51 ms +- 0.37 ms: 1.04x 
faster (-4%)
- pathlib: 43.1 ms +- 0.6 ms -> 41.7 ms +- 0.7 ms: 1.03x faster (-3%)
- html5lib: 193 ms +- 7 ms -> 188 ms +- 7 ms: 1.03x faster (-3%)
- richards: 149 ms +- 3 ms -> 145 ms +- 2 ms: 1.02x faster (-2%)
- pickle_pure_python: 1.01 ms +- 0.01 ms -> 984 us +- 20 us: 1.02x faster (-2%)

Benchmark hidden because not significant (38)

--

___
Python tracker 

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



[issue32559] logging - public function to get level from name

2018-01-16 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The use case of setting the level by name was already fulfilled in Python 3.2.  
 The logging.setLevel() function takes either an int or a string.

--
assignee:  -> vinay.sajip
nosy: +rhettinger, vinay.sajip
priority: normal -> low
versions:  -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.8

___
Python tracker 

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



[issue11849] glibc allocator doesn't release all free()ed memory

2018-01-16 Thread Bob Kline

Bob Kline  added the comment:

Would it be inappropriate for this fix to be applied to 2.7?

--
nosy: +bkline

___
Python tracker 

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



[issue11849] glibc allocator doesn't release all free()ed memory

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

It's not really a fix, it's an improvement, and as such doesn't belong in 2.7.  
Using malloc() and free() is not a bug in itself.

--

___
Python tracker 

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



[issue32564] Syntax error on using variable async

2018-01-16 Thread Andrew Olefira

Andrew Olefira  added the comment:

Yes, I understand, but "not recommended" != "not allowed".
For example library Pika (https://pypi.python.org/pypi/pika) use variable 
"async", so no one project that use lib Pika can't be launched on Python 3.7a4

--

___
Python tracker 

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



[issue32564] Syntax error on using variable async

2018-01-16 Thread Andrew Olefira

Change by Andrew Olefira :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue11849] glibc allocator doesn't release all free()ed memory

2018-01-16 Thread Bob Kline

Bob Kline  added the comment:

Sorry, I should have used the language of the patch author ("the resolution"). 
Without the resolution, Python 2.7 eventually runs out of memory and crashes 
for some correctly written user code.

--

___
Python tracker 

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



[issue32534] Speed-up list.insert

2018-01-16 Thread Jeethu Rao

Jeethu Rao  added the comment:

Built and benchmarked both the baseline and the patch without PGO; the 
differences are less pronounced, but still present.

https://gist.github.com/jeethu/abd404e39c6dfcbabb4c01661b9238d1

--

___
Python tracker 

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



[issue32553] venv says to use python3 which does not exist in 3.6.4

2018-01-16 Thread Paul Moore

Paul Moore  added the comment:

Agreed, the docs don't need to mention PATHEXT.

I don't have a machine to hand with Python 3.6 not installed, to check, but I 
believe the launcher is installed by default (although as you say it can be 
deselected - and it's definitely described as "recommended") whereas adding 
Python to PATH is deselected by default. So "py" is more likely to work on a 
typical installation than "python".

As I say, though, I have no feel here for the right level of detail. Maybe 
something like

"""
To execute the venv command, use

python -m venv

Unix installations typically name the Python 3.x executable "python3", and on 
Windows the "py" launcher is generally available even if the Python interpreter 
is not on your PATH, so you may need to substitute the appropriate means of 
invoking Python in place of the "python" command above.
"""

But that's (to my mind) still wordy and complex - and the new users I've spoken 
to already find the docs too full of confusing detail.

Ideally, I'd prefer it if "Invoking Python" were described once and for all in 
a separate section of the docs (i.e., the "Python Setup and Usage" manual) and 
everywhere else in the official documentation we simply used "python", with no 
qualifications, on the understanding that this stands for "whatever you use on 
your PC to run Python". I suspect that would generate complaints from a lot of 
people, though, as most people hit the doc pages via direct links, not by 
reading the manuals in order...

--

___
Python tracker 

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



[issue11849] glibc allocator doesn't release all free()ed memory

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, memory fragmentation can happen with any allocation scheme, and it's 
possible even Python 3 isn't immune to this.  Backporting performance 
improvements is a strain on our resources and also constitutes a maintenance 
threat (what if the bug hides in the new code?).  And Python 2.7 is really 
nearing its end-of-life more and more everyday.  So IMHO it's a no-no.

--

___
Python tracker 

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



[issue32534] Speed-up list.insert

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks.  That's really surprising.  I'll give it a try myself.

--

___
Python tracker 

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



[issue32564] Syntax error on using variable async

2018-01-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It raised a DeprecationWarning since 3.5. Most projects got rid of "async" and 
"await" identifiers before 3.7. File a bug in the Pika library.

--

___
Python tracker 

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



[issue32565] Document the version of adding opcodes

2018-01-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The version of adding a new opcode is not specified for some opcodes. The 
proposed PR adds missed 'versionadded' directives (as usually, only when added 
after 3.0).

--
assignee: docs@python
components: Documentation
messages: 310061
nosy: docs@python, ncoghlan, pitrou, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Document the version of adding opcodes
type: enhancement
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2018-01-16 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset b44c5169f64178d2ff2914187b315549e7ab0cb6 by Raymond Hettinger in 
branch 'master':
bpo-26163: Frozenset hash improvement (#5194)
https://github.com/python/cpython/commit/b44c5169f64178d2ff2914187b315549e7ab0cb6


--

___
Python tracker 

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



[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2018-01-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5052

___
Python tracker 

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



[issue32534] Speed-up list.insert

2018-01-16 Thread STINNER Victor

STINNER Victor  added the comment:

> jeethu@dev:cpython  (3.7_list_insert_memmove)$ ./python -m timeit -s "l = []" 
> "for _ in range(100): l.insert(0, None)"

Please don't use timeit, but perf timeit to run such *microbenchmark* (time 
smaller than 1 ms).

Your benchmark measures also the performance of the loop, it might be 
significant in such short loop (100 items). You may try to unroll the loop 
manually, and truncate the list:

vstinner@apu$ python3 -c 'print("l.insert(None); " * 3 + "l.clear();")'
l.insert(None); l.insert(None); l.insert(None); l.clear();

Example:

python3 -m perf timeit -s 'l=[]' $(python3 -c 'print("l.insert(0, None); " * 
100 + "l.clear();")') --duplicate 100


Jeethu Rao: Are you using CPU isolation? What is your OS?

--
nosy: +vstinner

___
Python tracker 

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



[issue32566] Not able to open Python IDLE

2018-01-16 Thread Kiran

New submission from Kiran :

Hello,

I am new to Python and installed python3 recently and when I try to open IDLE, 
Iam getting the error attached.

Please let me know how to resolve it.

Thanks.

--
components: Windows
files: Python.jpg
messages: 310062
nosy: Kiran, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Not able to open Python IDLE
type: crash
versions: Python 3.6
Added file: https://bugs.python.org/file47387/Python.jpg

___
Python tracker 

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



[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2018-01-16 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue32565] Document the version of adding opcodes

2018-01-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +5053
stage:  -> patch review

___
Python tracker 

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



[issue11849] glibc allocator doesn't release all free()ed memory

2018-01-16 Thread Bob Kline

Bob Kline  added the comment:

Thanks for your responses to my comments. I'm working as hard as I can to get 
my customer's systems migrated into the Python 3 world, and I appreciate the 
efforts of the community to provide incentives (such as the resolution for this 
failure) for developers to upgrade. However, it's a delicate balancing act 
sometimes, given that we have critical places in our system for which the same 
code runs more than twice as slowly on Python 3.6 as on Python 2.7.

--

___
Python tracker 

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



[issue32534] Speed-up list.insert: use memmove()

2018-01-16 Thread STINNER Victor

Change by STINNER Victor :


--
title: Speed-up list.insert -> Speed-up list.insert: use memmove()

___
Python tracker 

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



[issue32563] -Werror=declaration-after-statement expat build failure on Python 3.5

2018-01-16 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, I backported a fix to 3.4 but I forgot Python 3.5.

My fix for Python 3.4 is made of multiple bugfixes: 
8b11e8de7aedacfbbcc8c780f3c4097396f1d1a3

For Python 3.5, you want at least this change I think:

https://github.com/libexpat/libexpat/commit/e0b290eb3d8f4c4b45137a7d7f4f8db812145bd2

--

___
Python tracker 

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



[issue32561] Add API to io objects for non-blocking reads/writes

2018-01-16 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

That's a reasonable concern. Do you think we can deprecate the existing broken 
non-blocking mode?

--

___
Python tracker 

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



[issue11849] glibc allocator doesn't release all free()ed memory

2018-01-16 Thread INADA Naoki

INADA Naoki  added the comment:

FYI, jemalloc can reduce memory usage, especially when application
is multithreaded.

https://www.speedshop.co/2017/12/04/malloc-doubles-ruby-memory.html
https://zapier.com/engineering/celery-python-jemalloc/

--
nosy: +inada.naoki

___
Python tracker 

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



[issue32561] Add API to io objects for non-blocking reads/writes

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Do you think we can deprecate the existing broken non-blocking mode?

I would suggest asking on python-dev.  I wouldn't mind it, but perhaps there 
are people using it.

--

___
Python tracker 

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



[issue29708] support reproducible Python builds

2018-01-16 Thread Bernhard M. Wiedemann

Change by Bernhard M. Wiedemann :


--
keywords: +patch
pull_requests: +5054
stage:  -> patch review

___
Python tracker 

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



[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2018-01-16 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset e7dbd0658304f11daf103d56662656efecad006d by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.6':
bpo-26163: Frozenset hash improvement (GH-5194) (#5198)
https://github.com/python/cpython/commit/e7dbd0658304f11daf103d56662656efecad006d


--

___
Python tracker 

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



[issue32567] Venv’s config file (pyvenv.cfg) should be compatible with ConfigParser

2018-01-16 Thread Tzu-ping Chung

New submission from Tzu-ping Chung :

I’m not sure if it is intended, but it seems wrong to me that pyvenv.cfg is 
using a format that ConfigParser does not recognise. ConfigParser requires all 
values be placed under a section, but pyvenv.cfg does not do that.

Maybe related:

* ConfigParser’s format requirement: 
https://docs.python.org/3/library/configparser.html#supported-ini-file-structure
* How venv creates the configuration file: 
https://github.com/python/cpython/blob/master/Lib/venv/__init__.py#L141
* Abandoned discussion on whether ConfigParser should support section-less 
format #22253

--
components: Library (Lib)
messages: 310071
nosy: uranusjr
priority: normal
severity: normal
status: open
title: Venv’s config file (pyvenv.cfg) should be compatible with ConfigParser
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32568] Fix handling of sizehint=-1 in select.epoll()

2018-01-16 Thread Tal Einat

New submission from Tal Einat :

In 2fb9ae9dfc5a6830d902332ba93b13387e292ddb, select.epoll() was changed to 
reject sizehint=-1, despite that still being documented as the default value. 
Would it be possible to reverse this change, making -1 a special value 
signaling select.epoll() to use sizehint=FD_SETSIZE-1, as was before this 
change?

Additionally, in the same commit the docs were changed to say that the sizehint 
parameter is deprecated and has no effect, but later changes have restored use 
of sizehint in certain cases without updating the documentation. This 
inconsistency should be fixed.

For reference, this came up as part of #31938.

--
messages: 310072
nosy: benjamin.peterson, serhiy.storchaka, taleinat
priority: normal
severity: normal
status: open
title: Fix handling of sizehint=-1 in select.epoll()

___
Python tracker 

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



[issue32568] Fix handling of sizehint=-1 in select.epoll()

2018-01-16 Thread Tal Einat

Tal Einat  added the comment:

Also see discussion in GitHub PR 4265 for #31938.

--

___
Python tracker 

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



[issue32563] -Werror=declaration-after-statement expat build failure on Python 3.5

2018-01-16 Thread Nick Coghlan

Change by Nick Coghlan :


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

___
Python tracker 

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



[issue32563] -Werror=declaration-after-statement expat build failure on Python 3.5

2018-01-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

I couldn't persuade git to pull the upstream patch in directly, so I just made 
the same change downstream: https://github.com/python/cpython/pull/5201

--

___
Python tracker 

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



[issue32568] Fix handling of sizehint=-1 in select.epoll()

2018-01-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Extension Modules
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue32568] Fix handling of sizehint=-1 in select.epoll()

2018-01-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Also sizehint=0 was rejected before 2fb9ae9dfc5a6830d902332ba93b13387e292ddb. 
Now it is accepted.

--

___
Python tracker 

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



[issue32516] Add a shared library mechanism for win32

2018-01-16 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Putting .dll's next to their .pyd's isn't a general solution, because sometimes 
you want to be able to use the same .dll's from .pyd's that are in different 
directories. For example, scipy.spatial.qhull, scipy.optimize._lbfsgb, and 
scipy.linalg._flinalg are three different extensions in different directories, 
but they all link against BLAS. And you definitely don't want to include 
multiple copies of BLAS; the current scipy wheels on Linux are 50 MB, and 40 MB 
of that is *one* copy of OpenBLAS.

I don't think import hooks are terribly relevant here either. The big problem 
is how to arrange for the .dlls to be loaded before the .pyds. The obvious hack 
would be to somehow automatically rewrite the package __init__.py to either 
mutate PATH or pre-load the .dlls, which is admittedly pretty nasty. But... if 
you want to install an import hook, then that *also* requires rewriting the 
package __init__.py to inject the import hook installation code, and then the 
import hook would just be mutating PATH or pre-loading the .dlls. So adding an 
import hook to the mix doesn't seem to be buying much.

I guess I can see the argument for @xoviat's original proposal: if lots of 
packages are going to have weird code injected into their __init__.py just to 
add the same paths to the DLL search path, then maybe it's simpler all around 
if this becomes a standard feature of the Python importer. However, even if 
this were implemented we'd still need to write and maintain the __init__.py 
injection code for the next ~5 years, so probably the thing to do is to 
implement the __init__.py approach first and wait to see how it shakes out 
before considering interpreter changes.

--
nosy: +njs

___
Python tracker 

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



[issue32569] Blake2 module, memory clearance update

2018-01-16 Thread David Carlier

New submission from David Carlier :

Might brings a bit of "controversy" but some oses have already unoptimizable 
memset like functions from their libc was thinking to just use them instead.

--

___
Python tracker 

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



[issue32516] Add a shared library mechanism for win32

2018-01-16 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Probably better overall to go with a conda package which puts
the DLLs in a central location and manages the dependencies.

You can then load the DLL in the package before loading the PYD
and you're all set. Whether in an __init__.py or elsewhere is
really up to the package.

--

___
Python tracker 

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



[issue32569] Blake2 module, memory clearance update

2018-01-16 Thread David Carlier

Change by David Carlier :


--
components: Library (Lib)
nosy: David Carlier
priority: normal
pull_requests: 5056
severity: normal
status: open
title: Blake2 module, memory clearance update
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue32569] Blake2 module, memory clearance update

2018-01-16 Thread David Carlier

David Carlier  added the comment:

Since the PR had been closed.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32569] Blake2 module, memory clearance update

2018-01-16 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks for your contribution. Any optimization must land in upstream first, 
https://github.com/BLAKE2/libb2.

See https://bugs.python.org/issue17405 for more discussion on the topic.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue32569] Blake2 module, memory clearance update

2018-01-16 Thread Christian Heimes

Christian Heimes  added the comment:

In general your patch is a good idea. It should land in upstream, so everybody 
benefits from it. I also want to keep the maintenance burden as small as 
possible.

--

___
Python tracker 

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



[issue32569] Blake2 module, memory clearance update

2018-01-16 Thread David Carlier

David Carlier  added the comment:

No worries If I saw first it was an extra project I would not have try to 
submit in Cpython. Apologies. I ll see what I can do in blake2 side :-)

--

___
Python tracker 

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



[issue32544] Speed up hasattr(o, name) and getattr(o, name, default)

2018-01-16 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset 378edee0a3b913d60653dc17dfe61d83405a8135 by INADA Naoki in branch 
'master':
bpo-32544: Speed up hasattr() and getattr() (GH-5173)
https://github.com/python/cpython/commit/378edee0a3b913d60653dc17dfe61d83405a8135


--

___
Python tracker 

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



[issue32544] Speed up hasattr(o, name) and getattr(o, name, default)

2018-01-16 Thread INADA Naoki

Change by INADA Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue32516] Add a shared library mechanism for win32

2018-01-16 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Conda is cool but we're not currently planning to abandon wheels.

--

___
Python tracker 

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



[issue32544] Speed up hasattr(o, name) and getattr(o, name, default)

2018-01-16 Thread INADA Naoki

INADA Naoki  added the comment:

I confirmed django_template is `hasattr`-heavy benchmark.

Functionwas called by...
ncalls  tottime  cumtime
{built-in method builtins.hasattr}  <-   10.0000.000  
/home/inada-n/local/py37/lib/python3.7/site-packages/django/apps/registry.py:20(__init__)
...
 163180.0030.003  
/home/inada-n/local/py37/lib/python3.7/site-packages/django/utils/functional.py:81(__prepare_class__)
 90.0650.065  
/home/inada-n/local/py37/lib/python3.7/site-packages/django/utils/html.py:79(conditional_escape)
 932000.0640.064  
/home/inada-n/local/py37/lib/python3.7/site-packages/django/utils/safestring.py:129(mark_safe)
 90.0750.075  
/home/inada-n/local/py37/lib/python3.7/site-packages/django/utils/safestring.py:149(mark_for_escaping)

--

___
Python tracker 

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



[issue11849] glibc allocator doesn't release all free()ed memory

2018-01-16 Thread Bob Kline

Bob Kline  added the comment:

> ... jemalloc can reduce memory usage ...

Thanks for the tip. I downloaded the source and successfully built the DLL, 
then went looking for a way to get it loaded. Unfortunately, DLL injection, 
which is needed to use this allocator in Python, seems to be much better 
supported on Linux than on Windows. Basically, Microsoft's documentation [1] 
for AppInit_DLL, the shim for DLL injection on Windows, says (in effect) 
"here's how to use this technique, but we don't recommend using it, so here's a 
link [2] for what we recommend you do instead. That link takes you to "Try 
searching for what you need. This page doesn’t exist."

[1] 
https://support.microsoft.com/en-us/help/197571/working-with-the-appinit-dlls-registry-value
[2] https://support.microsoft.com/en-us/help/134655

--

___
Python tracker 

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



[issue32561] Add API to io objects for non-blocking reads/writes

2018-01-16 Thread YoSTEALTH

YoSTEALTH  added the comment:

There will be lot of confusion using "buffered" & "unbuffered" terminology, 
since python already has BufferedIOBase (as mentioned by Martin). It would be 
more appropriate to create io.CachedIOBase and add non-blocking argument to 
open(blocking=False) to enable this feature.

--
nosy: +YoSTEALTH

___
Python tracker 

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



[issue32503] Avoid creating small frames in pickle protocol 4

2018-01-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

In the current form the change is trivial, just an additional check. Actually 
it fixes a regression introduced in issue31993. Currently even empty frames can 
be produced (when fast=True).

--

___
Python tracker 

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



[issue11416] netrc module does not handle multiple entries for a single host

2018-01-16 Thread Yuri Bochkarev

Change by Yuri Bochkarev :


--
nosy: +Yuri.Bochkarev

___
Python tracker 

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



[issue31368] Support asynchronous, non-blocking buffered reads (RWF_NONBLOCK)

2018-01-16 Thread YoSTEALTH

YoSTEALTH  added the comment:

According to this nginx test 
https://www.nginx.com/blog/thread-pools-boost-performance-9x/ there is a huge 
boost in performance when using thread poll for File IO. It is postulated that 
when preadv2() & RWF_NONBLOCK feature are available it would further benefit 
(latency, thread sync, ...)

I am not a C coder so i can't just jump into this and code this feature (if i 
could i would have done it long ago). As Antoine mentioned, it needs to written 
at C (+ctypes) level.

I am willing to help, hit me up on #python user: stealth_

--

___
Python tracker 

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



[issue32544] Speed up hasattr(o, name) and getattr(o, name, default)

2018-01-16 Thread STINNER Victor

STINNER Victor  added the comment:

Cool. I always wanted to implement something similar. Nice work Naoki!

--
nosy: +vstinner

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2018-01-16 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +5057

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2018-01-16 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset c495e799ed376af91ae2ddf6c4bcc592490fe294 by Victor Stinner in 
branch 'master':
Skip test_readline.test_nonascii() on C locale (#5203)
https://github.com/python/cpython/commit/c495e799ed376af91ae2ddf6c4bcc592490fe294


--

___
Python tracker 

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



[issue31572] Avoid suppressing all exceptions in PyObject_HasAttr()

2018-01-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 4d9aec022063dcfc4cf40ae46b1c4a968297e664 by Serhiy Storchaka in 
branch 'master':
bpo-31572: Get rid of PyObject_HasAttr() and _PyObject_HasAttrId() in the _io 
module. (#3726)
https://github.com/python/cpython/commit/4d9aec022063dcfc4cf40ae46b1c4a968297e664


--

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2018-01-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5058

___
Python tracker 

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



[issue32559] logging - public function to get level from name

2018-01-16 Thread Varun Agrawal

Varun Agrawal  added the comment:

The request is not to set the level but to get the level given the level name 
aka textual representation. For example, passing in INFO should return 20 and 
passing in CRITICAL should return 50.

--

___
Python tracker 

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



[issue32536] ast and tokenize disagree about line number

2018-01-16 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue32534] Speed-up list.insert: use memmove()

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, I ran the benchmarks here (Ubuntu 16.04, Core i5-2500K, PGO and LTO 
disabled) and I don't get any consistent speedup, which is more in line with 
what I was expecting:
https://gist.github.com/pitrou/29eb7592fa1eae2be390f3bfa3db0a3a

--

___
Python tracker 

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



[issue32570] Python crash 0xc00000fd Windows10 x64 - "fail without words"

2018-01-16 Thread Василь Коломієць

New submission from Василь Коломієць :

The code https://ideone.com/ctx92s works for 1 000 000. 
But on my PC it works only for 1024.
Wen i am trting give him 1 000 000 - the Python crashes without any words:
https://i.stack.imgur.com/1do06.png
and in windows we can found this crash report: 
https://i.stack.imgur.com/nruoa.png
---
so it works for low values and crashes on higher values. Buy its no bug...
Than - What is it?

--
components: Windows
messages: 310095
nosy: Vasyl Kolomiets, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python crash  0xc0fd Windows10 x64  -  "fail without words"
type: crash
versions: Python 3.6

___
Python tracker 

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



[issue32559] logging - public function to get level from name

2018-01-16 Thread Zachary Ware

Zachary Ware  added the comment:

You could use `getattr(logging, levelname)` for that purpose.

--
nosy: +zach.ware

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2018-01-16 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset c2740e8a263e76427a8102a89f4b491a3089b2a1 by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
Skip test_readline.test_nonascii() on C locale (GH-5203) (#5204)
https://github.com/python/cpython/commit/c2740e8a263e76427a8102a89f4b491a3089b2a1


--

___
Python tracker 

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



[issue32410] Implement loop.sock_sendfile method

2018-01-16 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 6b5a27975a415108a5eac12ee302bf2b3233f4d4 by Andrew Svetlov in 
branch 'master':
bpo-32410: Implement loop.sock_sendfile() (#4976)
https://github.com/python/cpython/commit/6b5a27975a415108a5eac12ee302bf2b3233f4d4


--

___
Python tracker 

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



[issue32403] date, time and datetime alternate constructors should take fast construction path

2018-01-16 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset 9f1b7b93f5f0ef589e7b272e127cacf4ce5d23f1 by Alexander Belopolsky 
(Paul Ganssle) in branch 'master':
bpo-32403: Faster date and datetime constructors (#4993)
https://github.com/python/cpython/commit/9f1b7b93f5f0ef589e7b272e127cacf4ce5d23f1


--

___
Python tracker 

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



[issue32404] fromtimestamp does not call __new__ in datetime subclasses

2018-01-16 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset 9f1b7b93f5f0ef589e7b272e127cacf4ce5d23f1 by Alexander Belopolsky 
(Paul Ganssle) in branch 'master':
bpo-32403: Faster date and datetime constructors (#4993)
https://github.com/python/cpython/commit/9f1b7b93f5f0ef589e7b272e127cacf4ce5d23f1


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue32403] date, time and datetime alternate constructors should take fast construction path

2018-01-16 Thread Alexander Belopolsky

Change by Alexander Belopolsky :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

In issue32544 there was introduced a new private C API function 
_PyObject_GetAttrWithoutError() which never raises an AttributeError, but 
returns NULL without error set if an attribute is absent. This allowed to speed 
up Python builtins hasattr() and getattr() with the default argument.

But C code also could gain a benefit from this. It is common to look up an 
attribute and silence an AttributeError. Actually it is more common than the 
opposite case.

The proposed patch adds yet one function, _PyObject_GetAttrIdWithoutError(), 
and uses these two functions if it is possible to avoid checking an 
AttributeError after PyObject_GetAttr() and _PyObject_GetAttrId(). This could 
speed up some code, and also makes it cleaner.

--
components: Extension Modules, Interpreter Core
messages: 310101
nosy: inada.naoki, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Speed up and clean up getting optional attributes in C code
type: performance
versions: Python 3.7

___
Python tracker 

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



[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +5059
stage:  -> patch review

___
Python tracker 

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



[issue32572] Add the ftplib option, overrides the IP address.

2018-01-16 Thread Hideyuki

New submission from Hideyuki :

Add the ftplib's option, overrides the IP address to be used with the PORT 
command.
Currently, the PORT command is sending its self IP address.
If the host is connected with NAT, it will not work.
If that command has a NAT external IP address, it is working.
So add an option to overrides the IP address sending with the PORT command.
This is useful when active FTP transfer needed on a 1:1 NAT connected host so 
like AWS VPC.

--
components: Library (Lib)
messages: 310102
nosy: hideyuki
priority: normal
severity: normal
status: open
title: Add the ftplib option, overrides the IP address.
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue11191] test_search_cpp error on AIX (with xlc)

2018-01-16 Thread Michael Felt

Change by Michael Felt :


--
keywords: +patch
pull_requests: +5060
stage:  -> patch review

___
Python tracker 

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



[issue32572] Add the ftplib option, overrides the IP address.

2018-01-16 Thread Hideyuki

Change by Hideyuki :


--
keywords: +patch
pull_requests: +5061
stage:  -> patch review

___
Python tracker 

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



[issue32551] Zipfile & directory execution in 3.5.4 adds the current directory to sys.path

2018-01-16 Thread Eryk Sun

Eryk Sun  added the comment:

On Windows it's the directory that contains the zip file or directory with 
__main__.py, not the current directory. This seems normal to me. The directory 
or zip file is effectively executing as a script. I can understand wanting more 
isolated behavior in this case, i.e. make isolated mode the default when 
executing a directory or zip file as a script.

C:\>py -3.5 C:\Temp\spam
__file__:
 C:\Temp\spam\__main__.py
sys.path:
C:\Temp\spam
C:\Temp
C:\Program Files\Python35\python35.zip
C:\Program Files\Python35\DLLs
C:\Program Files\Python35\lib
C:\Program Files\Python35
C:\Program Files\Python35\lib\site-packages

C:\>py -3.5 C:\Temp\spam.zip
__file__:
 C:\Temp\spam.zip\__main__.py
sys.path:
C:\Temp\spam.zip
C:\Temp
C:\Program Files\Python35\python35.zip
C:\Program Files\Python35\DLLs
C:\Program Files\Python35\lib
C:\Program Files\Python35
C:\Program Files\Python35\lib\site-packages

--
nosy: +eryksun

___
Python tracker 

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



[issue32559] logging - public function to get level from name

2018-01-16 Thread Varun Agrawal

Varun Agrawal  added the comment:

@zach.ware: True, but since we already have a getLevelName method, having a 
symmetric method to do the opposite made sense. Plus the method can perform 
error checking and other things to ensure much cleaner code.

--

___
Python tracker 

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



[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread Pedro

New submission from Pedro :

Embedded Python interpreters, such as Boost.Python, do not have sys.argv 
available. (sys itself works fine.) This causes the interpreter to crash with 
the following exception when you try to access argv:

AttributeError: 'module' object has no attribute 'argv'

I'm not sure how closely related this is to #15577 or PEP 432. A simple 
workaround is to manually assign a list with an empty string to argv, as 
suggested by https://github.com/google/oauth2client/issues/642. However, the 
documentation for the sys module makes no mention of this special case for 
argv, and the line at the top that says "It is always available" can easily be 
interpreted to mean that *all* of sys's attributes will always be available. I 
suggest adding the following to the documentation for sys.argv:



Since `argv` contains the list of **command line** arguments passed to the 
Python interpreter, `argv` is not available within embedded interpreters, and 
scripts that run in embedded environments will raise an `AttributeError` when 
they attempt to access `argv`. As a workaround, assign a list with an empty 
string manually:
```
import sys

if not hasattr(sys, 'argv'):
sys.argv  = ['']
```

--
assignee: docs@python
components: Documentation
messages: 310105
nosy: docs@python, pgacv2
priority: normal
severity: normal
status: open
title: sys.argv documentation should include caveat for embedded environments
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-01-16 Thread Jay Crotts

Jay Crotts  added the comment:

Submitted a PR for this issue, awaiting review.

--

___
Python tracker 

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



[issue32574] asyncio.Queue, put() leaks memory if the queue is full

2018-01-16 Thread José Melero Fernández

New submission from José Melero Fernández :

Repro: asyncio queue with limited size and the queue full, call 
asyncio.wait_for(some_queue.put(1), some_timeout). Every canceled put produces 
a new item in queue._putters that is never deleted (memory leak). 

Uploaded to the issue a file with an example.

The get method had a very similar bug which was fixed in 2016-11. The related 
issue:
https://bugs.python.org/issue31620

I already have the code for the PR prepared, so I want to publish the link of 
the MR in a few of minutes.

--
components: asyncio
files: asyncio_put_memory_leak.py
messages: 310107
nosy: Mordis, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.Queue, put() leaks memory if the queue is full
type: resource usage
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47388/asyncio_put_memory_leak.py

___
Python tracker 

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



[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread R. David Murray

R. David Murray  added the comment:

A better question might be: is there something in the embedding framework that 
should initialize argv to the empty list?  embedding framework here could have 
two meanings: either the third party code, or the code that we provide for 
supporting embedding.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2018-01-16 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Catalin has been examining code... switching concurrent.futures.thread to use 
SimpleQueue instead of Queue is probably a good idea as the queues in there get 
used from weakref callbacks.

--

___
Python tracker 

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



[issue32516] Add a shared library mechanism for win32

2018-01-16 Thread xoviat

xoviat  added the comment:

As Nathaniel noted, the "solution" of placing DLLs in the same directory as 
extension modules is not a solution. I also think that some people here 
misunderstand my proposal: I'm not necessarily proposing that these directories 
are added using an import hook: they could be added on startup through a scan 
of site-packages.

"However, even if this were implemented we'd still need to write and maintain 
the __init__.py injection code for the next ~5 years, so probably the thing to 
do is to implement the __init__.py approach first and wait to see how it shakes 
out before considering interpreter changes."

Yes, this approach is already implemented in NumPy and SciPy. I'm also 
implementing it for other packages as well. However, the principal reason that 
I'm opening this issue is that Ray complained that packages shouldn't be 
altering the DLL search path: the only other solution that I can see is to make 
this documented behavior, only on Windows, and only because the Windows 
developers (and I'm in no way anti-Windows, but I'm just frustrated with this 
particular issue) decided to place an arbitrary limit on probingPath.

As far as the complaints about rpath: this is a mechanism used by every single 
manylinux and actually most OSX wheels, and it works perfectly.

--

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2018-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Could you open a new issue for it?

--

___
Python tracker 

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



[issue32549] Travis: Test with OpenSSL 1.1.0

2018-01-16 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset ced9cb5303ad1447f84d923e0c7f769f5e0c6297 by Christian Heimes in 
branch 'master':
bpo-32549: Compile OpenSSL 1.1.0 on Travis CI (#5180)
https://github.com/python/cpython/commit/ced9cb5303ad1447f84d923e0c7f769f5e0c6297


--

___
Python tracker 

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



[issue32574] asyncio.Queue, put() leaks memory if the queue is full

2018-01-16 Thread José Melero Fernández

Change by José Melero Fernández :


--
keywords: +patch
pull_requests: +5062
stage:  -> patch review

___
Python tracker 

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



[issue26692] cgroups support in multiprocessing

2018-01-16 Thread David Chin

David Chin  added the comment:

I would like to state strong support if is.get_usable_cpu_count()

I administer a typical HPC cluster which may have multiple jobs scheduled on 
the same physical server. The fact that multiprocessing ignores cgroups leads 
to bad oversubscription.

--
nosy: +hairygristle

___
Python tracker 

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



[issue32516] Add a shared library mechanism for win32

2018-01-16 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

> However, the principal reason that I'm opening this issue is that Ray 
> complained that packages shouldn't be altering the DLL search path

If that's crucial context, can you link to it?

--

___
Python tracker 

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



[issue32516] Add a shared library mechanism for win32

2018-01-16 Thread Steve Dower

Steve Dower  added the comment:

I understood the proposal just fine, and I understand the problems involved and 
appreciate why the ideal isn't sufficient here.

The import hook was my proposal to let you only preload DLLs when the extension 
module is being loaded, rather than having to load all the DLLs on the first 
"import scipy" just in case one of its submodules gets imported later. A hook 
can trigger on a specific module.

Since there appears to be some uncertainty, package __init__.py always runs 
before its submodules are even resolved, so it's totally fine to modify import 
machinery or preload DLLs here. 

rpath is totally irrelevant here. The OS model is different and we've given you 
the available options on Windows (application directory, process-wide search 
path, explicit preloading, assembly probing path).

--

___
Python tracker 

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



[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue32575] IDLE cannot locate certain SyntaxErrors raised by f-string expressions

2018-01-16 Thread Dan Snider

New submission from Dan Snider :

For example the following f-string

f'{1):.1%}'

IDLE will scroll to the top of the file and highlight a random and irrelevant 
line (not sure what it's doing tbh).

running the expression with `exec` makes it look like implicit parenthesis are 
added to the ends of files..

>>> exec("f'{1):.1f}'")
Traceback (most recent call last):
  File "", line 1, in 
exec("f'{1):.1f}'")
  File "", line 1
(1))
   ^
SyntaxError: unexpected EOF while parsing

IDLE can correctly find a `(1))` in a file but appears to fail only in f-string 
expressions.

--
assignee: terry.reedy
components: IDLE
messages: 310117
nosy: bup, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE cannot locate certain SyntaxErrors raised by f-string expressions
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2018-01-16 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +5064

___
Python tracker 

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



[issue32516] Add a shared library mechanism for win32

2018-01-16 Thread xoviat

xoviat  added the comment:

This is what ray said:

"Please do not do this. Importing a specific module should not modify the way 
that process loads subsequent DLLs."

(https://github.com/numpy/numpy/pull/10229#issuecomment-354846459)

What I'm proposing to do is write a tool, widely used like auditwheel, that 
will copy shared libraries into the .libs folder and then patch __init__.py in 
all packages in order to modify the DLL search path to add these folders.

If everyone's okay with that, we can close this issue. But if everyone's not 
okay with that, then we need to document that it's Python's responsibility to 
do this.

--

___
Python tracker 

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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2018-01-16 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
pull_requests:  -5016

___
Python tracker 

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



[issue32575] IDLE cannot locate certain SyntaxErrors raised by f-string expressions

2018-01-16 Thread Eric V. Smith

Eric V. Smith  added the comment:

This is not an IDLE bug, per se. There's a known problem with f-strings not 
producing the correct line numbers. See issue #29051. Unless Terry thinks 
there's something IDLE-specific here, I suggest closing this as a duplicate.

--
nosy: +eric.smith

___
Python tracker 

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



[issue31299] Add "ignore_modules" option to TracebackException.format()

2018-01-16 Thread Dmitry Kazakov

Change by Dmitry Kazakov :


--
pull_requests: +5065
stage: needs patch -> patch review

___
Python tracker 

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



  1   2   >