[issue23434] support encoded filename in Content-Disposition for HTTP in cgi.FieldStorage

2018-03-22 Thread R. David Murray

R. David Murray  added the comment:

I haven't read the http rfcs, but my understanding is that they follow the MIME 
standards, and the email library already has code to do proper parsing and 
decoding of encoded filenames in Content-Disposition headers.  It should be 
possible to call that code for this use case (the http libraries already depend 
on the email libraries, although I'm not sure if cgi itself does currently).  
There may be additional considerations involved in fully supporting the http 
RFCs, but to determine that someone will need to read both and understand them, 
which is not a small undertaking :)

In the meantime, I'm pretty sure that using the existing mime header parsing 
code in the email library (see email.headerregistry) will provide better 
parsing than the only-handles-simple-cases heuristic in your PR.  Granted, I 
don't think you have to deal with multi-part headers in http, but I vaguely 
remember that there are other subtleties not handled by a simple split on '.

--

___
Python tracker 

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



[issue33125] Windows 10 ARM64 platform support

2018-03-22 Thread Steven Noonan

Steven Noonan  added the comment:

Oh, another change I had to make was remove all the BaseAddress elements in the 
Link sections. The linker complains if these are used (the lower 4GB of memory 
are apparently reserved for the x86 emulation). Also, from what I was told by 
someone over at Microsoft, the BaseAddress options don't do anything useful on 
modern Windows versions unless you build with -fixed as well, because 
everything gets relocated anyway.

--

___
Python tracker 

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



[issue33125] Windows 10 ARM64 platform support

2018-03-22 Thread Steven Noonan

New submission from Steven Noonan :

The Windows 10 ARM64 release is out along with a bunch of ARM64 devices. This 
version of Windows has full support for building native Win32 applications 
(this isn't just some rehash of Windows RT). It also can run x86 (but not 
x86_64) apps under a transparent emulation layer.

I would like to see a native build of Python on Windows 10 ARM64.

I did some very basic work to get it compiling (add 10.0.16299.0 as 
DefaultWindowsSDKVersion, add WindowsSDKDesktopARM64Support property). But 
there's still a lot missing: ssl, tk, and ctypes don't build.

ssl/ctypes have some assembly that needs writing/porting.

tk has some kind of build failure with the newer Windows SDK: 
https://core.tcl.tk/tk/tktview?name=3d34589aa0

--
components: Windows
messages: 314295
nosy: Steven Noonan, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows 10 ARM64 platform support
type: enhancement
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



[issue27212] Doc for itertools, 'islice()' implementation have unwanted behavior for recipe 'consume()'

2018-03-22 Thread Cheryl Sabella

Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue33119] python sys.argv argument parsing not clear

2018-03-22 Thread Brett Cannon

Change by Brett Cannon :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue33124] Lazy execution of module bytecode

2018-03-22 Thread Brett Cannon

Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue33124] Lazy execution of module bytecode

2018-03-22 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue33124] Lazy execution of module bytecode

2018-03-22 Thread Neil Schemenauer

Change by Neil Schemenauer :


--
keywords: +patch
pull_requests: +5941

___
Python tracker 

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



[issue33124] Lazy execution of module bytecode

2018-03-22 Thread Neil Schemenauer

New submission from Neil Schemenauer :

This is an experimental patch that implements lazy execution of top-level 
definitions in modules (functions, classes, imports, global constants).  See 
Tools/lazy_compile/README.txt for details.

--
components: Interpreter Core
messages: 314294
nosy: nascheme
priority: low
severity: normal
stage: patch review
status: open
title: Lazy execution of module bytecode
type: enhancement

___
Python tracker 

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



[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Eric V. Smith

Change by Eric V. Smith :


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



[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread miss-islington

miss-islington  added the comment:


New changeset 3b4c6b16c597aa2356f5658dd67da7dcd4434038 by Miss Islington (bot) 
in branch '3.7':
bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, 
but doesn't have a type annotation. (GH-6192)
https://github.com/python/cpython/commit/3b4c6b16c597aa2356f5658dd67da7dcd4434038


--
nosy: +miss-islington

___
Python tracker 

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



[issue30071] Duck-typing inspect.isfunction()

2018-03-22 Thread Jeroen Demeyer

Jeroen Demeyer  added the comment:

See https://mail.python.org/pipermail/python-ideas/2018-March/049398.html

--

___
Python tracker 

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



[issue30953] Fatal python error when jumping into except clause

2018-03-22 Thread ppperry

ppperry  added the comment:

... with a bad error message, because there are no finally blocks in the code

--

___
Python tracker 

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



[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Eric V. Smith

Eric V. Smith  added the comment:


New changeset 56970b8ce9d23269d20a76f13c80e670c856ba7f by Eric V. Smith in 
branch 'master':
bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, 
but doesn't have a type annotation. (GH-6192)
https://github.com/python/cpython/commit/56970b8ce9d23269d20a76f13c80e670c856ba7f


--

___
Python tracker 

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



[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5940

___
Python tracker 

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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

LGTM.

> What should I write instead of _?

(ValueError, OSError)

> And will the next call be effective (do anything), if we have already set the 
> limit with the testing call?

This doesn't matter. We test that it doesn't crash when parse arguments.

--

___
Python tracker 

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



[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Eric V. Smith

Change by Eric V. Smith :


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

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

> I suppose that it would also be difficult to get buy-in for a feature like 
> this from the different frameworks?

Maybe :)  Ideally, asyncio programs should not depend on how exactly tasks are 
scheduled.

--

___
Python tracker 

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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2018-03-22 Thread Ivan Zakharyaschev

Ivan Zakharyaschev  added the comment:

And will the next call be effective (do anything), if we have already set the 
limit with the testing call?

--

___
Python tracker 

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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2018-03-22 Thread Ivan Zakharyaschev

Ivan Zakharyaschev  added the comment:

Thanks! I also thought about this simplest way. What about this:

diff --git a/Python/Lib/test/test_resource.py b/Python/Lib/test/test_resource.py
index de29d3b..bec4440 100644
--- a/Python/Lib/test/test_resource.py
+++ b/Python/Lib/test/test_resource.py
@@ -102,16 +102,21 @@ class ResourceTest(unittest.TestCase):
 
 # Issue 6083: Reference counting bug
 def test_setrusage_refcount(self):
+howmany = 100
 try:
 limits = resource.getrlimit(resource.RLIMIT_CPU)
 except AttributeError:
 self.skipTest('RLIMIT_CPU not available')
+try:
+resource.setrlimit(resource.RLIMIT_CPU, (howmany, howmany))
+except _:
+self.skipTest('Setting RLIMIT_CPU not possible')
 class BadSequence:
 def __len__(self):
 return 2
 def __getitem__(self, key):
 if key in (0, 1):
-return len(tuple(range(100)))
+return len(tuple(range(howmany)))
 raise IndexError
 
 resource.setrlimit(resource.RLIMIT_CPU, BadSequence())

What should I write instead of _?

--

___
Python tracker 

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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The simplest way is to try passing the limit as a tuple

resource.setrlimit(resource.RLIMIT_CPU, (100, 100))

and skip the test if it failed.

--

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Vitaly Kruglikov

Vitaly Kruglikov  added the comment:

Yet another paradigm is the likes of `GSource` in gnome's glib. GSource "tasks" 
added to the event loop are polled by the event loop for readiness before the 
event loop blocks on select/epoll/etc.. The ones that are ready are removed 
from the loop and their callbacks are dispatched.

I suppose that it would also be difficult to get buy-in for a feature like this 
from the different frameworks?

--

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Vitaly Kruglikov

Vitaly Kruglikov  added the comment:

I'll have to settle for `set_write_buffer_limits(0, 0)` for my blocking wrapper 
case.

I think that 'write_buffer_drained' callback is a good idea, though.

--

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Vitaly Kruglikov

Vitaly Kruglikov  added the comment:

> 'events.AbstractEventLoop.run_one_step()'

> This is highly unlikely to ever happen.

Sure, I can see how that could be a problem with other underlying 
implementations, such as Twisted reactor. Just wishful thinking :).

--

___
Python tracker 

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



[issue33115] Asyncio loop blocks with a lot of parallel tasks

2018-03-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Does this mean that GC uses most part of CPU time so the loop blocks?

GC stops all Python code in the OS process from running.  Because of the GIL 
code in threads will obviously be stopped too.  This is true for both CPython 
and PyPy at this moment.

> And another question: do you have any plans to optimize the loop so it would 
> be possible to run really lot of tasks in parallel?

The only way of doing this is to have a few asyncio OS processes (because of 
the GIL we can't implement M:N scheduling in a single Python process).  So it's 
not going to happen in the foreseeable future :(

--

___
Python tracker 

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



[issue33123] Path.unlink should have a missing_ok parameter

2018-03-22 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

> 'events.AbstractEventLoop.run_one_step()'

This is highly unlikely to ever happen.  It's hard to define what one iteration 
of an event loop is, and it would be even harder to get that agreement for all 
frameworks/event loops that are compatible with or based on asyncio.

--

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

Yeah, I think your best option would be to use `set_write_buffer_limits(0, 0)`. 
 You don't need asyncio flow control anyways, as AMQP protocol is unlikely to 
generate any pressure on IO buffers.

--

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Vitaly Kruglikov

Vitaly Kruglikov  added the comment:

... or `events.AbstractEventLoop.run_one_iteration()`.

--

___
Python tracker 

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



[issue33123] Path.unlink should have a missing_ok parameter

2018-03-22 Thread rbu

New submission from rbu :

Similarly to how several pathlib file creation functions have an "exists_ok" 
parameter, we should introduce "missing_ok" that makes removal functions not 
raise an exception when a file or directory is already absent.

IMHO, this should cover Path.unlink and Path.rmdir.

Note, Path.resolve() has a "strict" parameter since 3.6 that does the same 
thing. Naming this of this new parameter tries to be consistent with the 
"exists_ok" parameter as that is more explicit about what it does (as opposed 
to "strict").

--
components: Library (Lib)
messages: 314277
nosy: rbu
priority: normal
severity: normal
status: open
title: Path.unlink should have a missing_ok parameter
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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-22 Thread Brett Cannon

Brett Cannon  added the comment:

I can't make any promises unfortunately.

--

___
Python tracker 

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



[issue33115] Asyncio loop blocks with a lot of parallel tasks

2018-03-22 Thread Marat Sharafutdinov

Marat Sharafutdinov  added the comment:

Does this mean that GC uses most part of CPU time so the loop blocks?

And another question: do you have any plans to optimize the loop so it would be 
possible to run really lot of tasks in parallel?

Thanks.

--

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Vitaly Kruglikov

Vitaly Kruglikov  added the comment:

Thank you for following up. My use case is this:

In the Pika AMQP client package, we have a blocking AMQP connection adapter - 
`BlockingConnection` - wrapped around an asynchronous AMQP connection adapter. 
Presently, BlockingConnection is wrapped around the asynchronous 
`SelectConnection` which has a home-grown proprietary IOLoop. I would like to 
switch BlockingConnection to use an asyncio-based adapter when running on 
Python3.

SelectConnection's proprietary IOLoop provides a single-stepping run function 
(poll with a timeout as normally determined by pending callbacks, timers, etc., 
process all ready events/timers/callbacks, and return). When BlockingConnection 
needs to send something to the AMQP broker and/or wait for an expected reply, 
it sends the request (which typically gets queued up in a write buffer) and 
then runs the proprietary IOLoop's single-stepping method in a loop (thus 
blocking efficiently on I/O); each time after the single-stepping IOLoop method 
returns, BlockingConnection checks whether the conditions of interest have been 
satisfied (e.g., the write buffer size being zero and AMQP Channel.OpenOk has 
been received).

So, another way that asyncio could help, and certainly simplest for me and my 
use case, is by providing a single-stepping function in the event loop 
implementations, such as the single-stepping method that I described at the top 
of the previous paragraph. E.g., `events.AbstractEventLoop.run_one_step()`.

--

___
Python tracker 

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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2018-03-22 Thread Ivan Zakharyaschev

Ivan Zakharyaschev  added the comment:

>>> import resource
>>> resource.getrlimit(resource.RLIMIT_CPU) 
(7200, 7260)

--

___
Python tracker 

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



[issue30953] Fatal python error when jumping into except clause

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is fixed in 3.8.

Traceback (most recent call last):
  File "issue30953.py", line 15, in 
error()
  File "issue30953.py", line 14, in error
pass
  File "issue30953.py", line 14, in error
pass
  File "issue30953.py", line 4, in trace
frame.f_lineno = 12
ValueError: can't jump into or out of a 'finally' block

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

We'll likely add 'write_buffer_drained' callback method to `asyncio.Protocol` 
in 3.8.  In the meanwhile, the only option would be using `_make_empty_waiter` 
in 3.7, or set_write_buffer_limits(0, 0).

What's your use case, by the way?

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



[issue33120] infinite loop in inspect.unwrap(unittest.mock.call)

2018-03-22 Thread Peter

Peter  added the comment:

I see two options to fix it:

1) add recursion depth check to inspect.wrap
2) define __wrapped__ on mock._Call so it won't go into recursion.

--

___
Python tracker 

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



[issue27212] Doc for itertools, 'islice()' implementation have unwanted behavior for recipe 'consume()'

2018-03-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Thanks, Raymond.  I'll take a look.

--

___
Python tracker 

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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What does resource.getrlimit(resource.RLIMIT_CPU) return?

--

___
Python tracker 

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



[issue33082] multiprocessing docs bury very important 'callback=' args

2018-03-22 Thread Chad

Chad  added the comment:

On topic: My CLA is signed as of Monday, 19 March. My status here is not 
updated yet.


pitrou, off-topic: Without callbacks, users who want multiprocessing functions 
to return something, not just mutate state somewhere else, must gather jobs in 
a list and continually iterate through them polling to see if each has finished 
yet and conditionally popping it from the list. It's expensive and ugly and 
error-prone. Callbacks are really great, you should try them again.

So much better:

pool.apply_async(func, args, callback=when_finished_call_with_result)

--

___
Python tracker 

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



[issue33027] handling filename encoding in Content-Disposition by cgi.FieldStorage

2018-03-22 Thread Paweł

Paweł  added the comment:

duplicate of https://bugs.python.org/issue23434

--
resolution:  -> duplicate
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



[issue23434] support encoded filename in Content-Disposition for HTTP in cgi.FieldStorage

2018-03-22 Thread Paweł

Paweł  added the comment:

I didn't find this and created a duplicate
https://bugs.python.org/issue33027

I've added similar/updated changes
https://github.com/python/cpython/pull/6027

@r.david.murray wouldn't it be wise to do one step at a time rather than 
implementing full support for RFC6266? Please tell exactly what is your 
expectations so I can fix the patch if it needs to be fixed.

This is also related to RFC5987
https://tools.ietf.org/html/rfc5987
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

--
components: +Unicode
nosy: +ezio.melotti, pawciobiel, vstinner
pull_requests: +5937
stage:  -> patch review
title: RFC6266 support (Content-Disposition for HTTP) -> support encoded 
filename in Content-Disposition for HTTP in cgi.FieldStorage
versions: +Python 2.7, Python 3.4, Python 3.5, 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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2018-03-22 Thread Ivan Zakharyaschev

Ivan Zakharyaschev  added the comment:

> New changeset a4c85f9b8f58 by Serhiy Storchaka in branch '2.7':
Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
http://hg.python.org/cpython/rev/a4c85f9b8f58

This test has a problem: though it tests not the ability to set a CPU hard 
limit, it fails if the hard limit is limited. Perhaps, ignore any exception 
there? Could you please help me re-write it correctly, so that I can run it on 
gyle--ALT's builder host--successfully):

# Issue 6083: Reference counting bug
def test_setrusage_refcount(self):
try:
limits = resource.getrlimit(resource.RLIMIT_CPU)
except AttributeError:
self.skipTest('RLIMIT_CPU not available')
class BadSequence:
def __len__(self):
return 2
def __getitem__(self, key):
if key in (0, 1):
return len(tuple(range(100)))
raise IndexError

resource.setrlimit(resource.RLIMIT_CPU, BadSequence())

The failure:

[builder@team ~]$ python /usr/lib64/python2.7/test/test_resource.py
test_args (__main__.ResourceTest) ... ok
test_fsize_enforced (__main__.ResourceTest) ... ok
test_fsize_ismax (__main__.ResourceTest) ... ok
test_fsize_toobig (__main__.ResourceTest) ... ok
test_getrusage (__main__.ResourceTest) ... ok
test_setrusage_refcount (__main__.ResourceTest) ... ERROR

==
ERROR: test_setrusage_refcount (__main__.ResourceTest)
--
Traceback (most recent call last):
  File "/usr/lib64/python2.7/test/test_resource.py", line 117, in 
test_setrusage_refcount
resource.setrlimit(resource.RLIMIT_CPU, BadSequence())
ValueError: not allowed to raise maximum limit

--
Ran 6 tests in 0.085s

FAILED (errors=1)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/test/test_resource.py", line 123, in 
test_main()
  File "/usr/lib64/python2.7/test/test_resource.py", line 120, in test_main
test_support.run_unittest(ResourceTest)
  File "/usr/lib64/python2.7/test/support/__init__.py", line 1577, in 
run_unittest
_run_suite(suite)
  File "/usr/lib64/python2.7/test/support/__init__.py", line 1542, in _run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "/usr/lib64/python2.7/test/test_resource.py", line 117, in 
test_setrusage_refcount
resource.setrlimit(resource.RLIMIT_CPU, BadSequence())
ValueError: not allowed to raise maximum limit

[builder@team ~]$

--
nosy: +imz

___
Python tracker 

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



[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Eric V. Smith

Eric V. Smith  added the comment:

Thanks for the offer. I've already got the code written, I just need to write 
some tests. I'll get it done real soon now.

--
components: +Library (Lib)
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



[issue30416] constant folding opens compiler to quadratic time hashing

2018-03-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +benjamin.peterson
priority: normal -> deferred blocker
versions: +Python 2.7 -Python 3.7

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-22 Thread Ned Deily

Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg314252

___
Python tracker 

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



[issue19979] Missing nested scope vars in class scope (bis)

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This looks like a duplicate of issue9226.

--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue33122] ftplib: FTP_TLS seems to have problems with sites that close the encrypted channel themselfes

2018-03-22 Thread Jürgen

New submission from Jürgen :

Hi,

I'm not quite sure, if you would actually call this a bug, but it is very 
molesting at least ;o)

I use ftplib.FTP_TLS to connect to a z/OS ftp server. With a minor change it 
works very well (happy to have found this library).
The problem I have is, that without any change, an exception is raised after 
every single command I invoke, even though the server sends back an ok message.

The exception is an OSError which is raised while executing conn.unwrap(). It 
seems the connection is already closed when this is called and thus an 
exception is raised. But handling this exception outside the FTP_TLS-class 
makes no sense, because then every command would raise an exception and the 
"good" exceptions could not be distinguised from the ones that are really 
searious so easily anymore (I mean: if i get an exception that a connection 
could not be closed, because someone else closed it before, that's not very 
serious, is it?).

Suggestions to solve this:
small solution: allow the programmer to decide what to do, by creating 
subclasses
This is "factor-out" the unwrap logic in a separate method or function, so at 
least users of the class can overwrite the behavior, without having to rebuild 
the whole logic of the affected methods.

In my quick solution I created a new method in class FTP:
def __handleAutoCloseSSL__(self, conn):
if self.autoCloseModeSSL == 'NONE' or self.autoCloseModeSSL is None or 
_SSLSocket is None or not isinstance(conn, _SSLSocket):
# do nothing
pass
elif self.autoCloseModeSSL in ('SAFE', 'HIDE'):
try:
conn.unwrap()
except OSError as ex:
if self.autoCloseModeSSL != 'HIDE':
print('Caught exception %s while calling conn.unwrap()' % 
str(ex))
else:
# Standard mode (usally self.autoCloseModeSSL =='STANDARD' but 
anything else is accepted as well)
# the original code was:
#if _SSLSocket is not None and isinstance(conn, _SSLSocket):
#conn.unwrap()
conn.unwrap()

And the class variable:
autoCloseModeSSL = 'STANDARD'

Then I called it from methods (instead of doing conn.unwrap() there directly):
retbinary
retlines
storbinary
storlines

Ok, maybe not that sexy, but it works :o)
And if you don't like the hack with instance variable autoCloseModeSSL, you 
could just transfer the original conn.unwrap() in an extra method which could 
then be overwritten by programmers in subclasses. This would already help me 
very much, because I know that patching a library is not a good idea. Even more 
if it is a communication library that might be updated from time to time.

--
components: Library (Lib)
messages: 314261
nosy: jottbe
priority: normal
severity: normal
status: open
title: ftplib: FTP_TLS seems to have problems with sites that close the 
encrypted channel themselfes
type: behavior
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



[issue33121] recv returning 0 on closed connection not documented

2018-03-22 Thread joders

New submission from joders :

The "Linux Programmer's Manual" states:

When a stream socket peer has performed an orderly shutdown, the return value 
will be 0 (the traditional "end-of-file" return).

I find that information pretty important which is why I am asking if you might 
want to add it to the python documentation as well. It would have prevented a 
bug in my code.

--
assignee: docs@python
components: Documentation
messages: 314260
nosy: docs@python, joders
priority: normal
severity: normal
status: open
title: recv returning 0 on closed connection not documented
type: enhancement
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



[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

> you'll notice that's an error?

Yes, but there are other scenarios, like using `init=False` or updating 
existing class definition and forgetting to update call sites (which will still 
work), etc.

What would we lose by not flagging this as an error? I think there are no 
legitimate use cases for such code, and implementation is straightforward. If 
you don't have time I can do this myself.

--

___
Python tracker 

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



[issue17861] put opcode information in one place

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Currently an explicit `make regen-opcode` and `make regen-opcode-targets` (or 
just `make regen-all`) are needed for regenerating C files from opcode.py.

Is anything left to do in this issue?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

I am closing this for now. We can re-open it later if problems will appear in 
3.7.

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset 5d8bb5d07be2a9205e7059090f0ac5360d36b217 by Ivan Levkivskyi (Miss 
Islington (bot)) in branch '3.7':
bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189) (GH-6190)
https://github.com/python/cpython/commit/5d8bb5d07be2a9205e7059090f0ac5360d36b217


--

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset 5d8bb5d07be2a9205e7059090f0ac5360d36b217 by Ivan Levkivskyi (Miss 
Islington (bot)) in branch '3.7':
bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189) (GH-6190)
https://github.com/python/cpython/commit/5d8bb5d07be2a9205e7059090f0ac5360d36b217


--

___
Python tracker 

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



[issue33120] infinite loop in inspect.unwrap(unittest.mock.call)

2018-03-22 Thread Peter

New submission from Peter :

The following module will eat all available RAM if executed:

import inspect
import unittest.mock
print(inspect.unwrap(unittest.mock.call))

inspect.unwrap has loop protection against functions that wrap themselves, but 
unittest.mock.call creates new object on demand.

--
components: Library (Lib)
messages: 314254
nosy: peterdemin
priority: normal
severity: normal
status: open
title: infinite loop in inspect.unwrap(unittest.mock.call)
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



[issue32234] Add context management to mailbox.Mailbox

2018-03-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

It looks like Barry was ready to merge this PR in December.  Is there anything 
else that needs to be done for it?  Thanks!

--
nosy: +csabella

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-22 Thread Viv

Viv  added the comment:

Thanks, worked a treat https://www.allcarleasing.co.uk/special-offers/

--
nosy: +Viv

___
Python tracker 

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5935

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5936

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset f757b72b2524ce3451d2269f0b8a9f0593a7b27f by INADA Naoki in branch 
'master':
bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189)
https://github.com/python/cpython/commit/f757b72b2524ce3451d2269f0b8a9f0593a7b27f


--

___
Python tracker 

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset f757b72b2524ce3451d2269f0b8a9f0593a7b27f by INADA Naoki in branch 
'master':
bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189)
https://github.com/python/cpython/commit/f757b72b2524ce3451d2269f0b8a9f0593a7b27f


--

___
Python tracker 

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



[issue23203] Aliasing import of sub-{module, package} from the package raises AttributeError on import.

2018-03-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Heh, apparently I forgot how IMPORT_FROM currently works some time between 2015 
and 2017 :)

I agree this is out of date now, as the requested behaviour was already 
implemented for 3.7

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Brett or Eric, any chance one of you could run with this for 3.7b3? I already 
have a startup refactoring related regression that I'm aiming to have fixed 
before then.

Thanks to Victor's refactoring work, there's at least a clear interception 
point now where we can treat the empty string differently depending on whether 
the command line option was `-c`, `-m`, or not specified at all: 
https://github.com/python/cpython/blob/master/Python/pathconfig.c#L259

As an initial attempt, I think the necessary fix will be along the lines of 
checking for 'n == 0 && argc > 1 && wcscmp(argv0, L"-m") == 0', and resolving 
the current working directory in that case.

--

___
Python tracker 

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread INADA Naoki

Change by INADA Naoki :


--
pull_requests: +5933

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread INADA Naoki

Change by INADA Naoki :


--
pull_requests: +5934

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread miss-islington

miss-islington  added the comment:


New changeset 346964ba0586e402610ea886e70bee1294874781 by Miss Islington (bot) 
in branch '3.7':
bpo-33018: Improve issubclass() error checking and message. (GH-5944)
https://github.com/python/cpython/commit/346964ba0586e402610ea886e70bee1294874781


--
nosy: +miss-islington

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread miss-islington

Change by miss-islington :


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

___
Python tracker 

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



[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset 40472dd42de4f7265d456458cd13ad6894d736db by Ivan Levkivskyi (jab) 
in branch 'master':
bpo-33018: Improve issubclass() error checking and message. (GH-5944)
https://github.com/python/cpython/commit/40472dd42de4f7265d456458cd13ad6894d736db


--

___
Python tracker 

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



[issue23203] Aliasing import of sub-{module, package} from the package raises AttributeError on import.

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is anything left to do with this issue after issue30024?

--

___
Python tracker 

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



[issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long

2018-03-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage:  -> needs patch
versions: +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



[issue32838] Fix Python versions in the table of magic numbers

2018-03-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue25828] PyCode_Optimize() (peephole optimizer) doesn't handle KeyboardInterrupt correctly

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I can reproduce a crash in 3.5, but not in 3.6. Seems it was fixed in 
issue30416.

--

___
Python tracker 

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



[issue24565] the f_lineno getter is broken

2018-03-22 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

I will work on it shortly.

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What should we do with this issue? Does it need opening a topic on Python-Dev?

--

___
Python tracker 

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



[issue28962] Crash when throwing an exception with a malicious __hash__ override

2018-03-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
versions:  -Python 3.3

___
Python tracker 

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



[issue28962] Crash when throwing an exception with a malicious __hash__ override

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Seems it was fixed somewhere between 3.6.3 and 3.6.5+.

Traceback (most recent call last):
  File "baderror.py", line 10, in 
raise e from e
__main__.BadError

3.5 is now in security-only fixes stage, and this doesn't look like a security 
issue.

--
nosy: +serhiy.storchaka
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue26286] dis module: coroutine opcode documentation clarity

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

(2) is already fixed.

SETUP_ASYNC_WITH talks about the same frame blocks as pushed by SETUP_FINALLY, 
SETUP_EXCEPT, SETUP_LOOP and popped by POP_BLOCK. But unlike to SETUP_FINALLY 
it pushes a frame block pointing below TOS. This detail needs to be documented.

Do you mind to create a pull request Jim?

--
nosy: +serhiy.storchaka
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue33119] python sys.argv argument parsing not clear

2018-03-22 Thread Jonathan Huot

New submission from Jonathan Huot :

Executing python modules with -m can lead to weird sys.argv parsing.

"Argument parsing" section at 
https://docs.python.org/3.8/tutorial/interpreter.html#argument-passing mention :

- When -m module is used, sys.argv[0] is set to the full name of the located 
module.

The word "located" is used, but it doesn't mention anything when the module is 
not *yet* "located".

For instance, let's see what is the sys.argv for each python files:


$ cat mainmodule/__init__.py
import sys; print("{}: {}".format(sys.argv, __file__))
$ cat mainmodule/submodule/__init__.py
import sys; print("{}: {}".format(sys.argv, __file__))
$ cat mainmodule/submodule/foobar.py
import sys; print("{}: {}".format(sys.argv, __file__))


Then we call "foobar" with -m:

$ python -m mainmodule.submodule.foobar -o -b
['-m', '-o', 'b']: (..)/mainmodule/__init__.py
['-m', '-o', 'b']: (..)/mainmodule/submodule/__init__.py
['(..)/mainmodule/submodule/foobar.py', '-o', 'b']: 
(..)/mainmodule/submodule/foobar.py
$


We notice that only "-m" is in sys.argv before we found "foobar". This can lead 
to a lot of troubles when we have meaningful processing in __init__.py which 
rely on sys.argv to initialize stuff.

IMHO, it either should be the sys.argv intact ['-m', 
'mainmodule.submodule.foobar', '-o', '-b'] or empty ['', '-o', '-b'] or  only 
the latest ['-o', '-b'], but it should not be ['-m', '-o', '-b'] which is very 
confusing.

--
assignee: docs@python
components: Documentation
messages: 314239
nosy: Jonathan Huot, docs@python
priority: normal
severity: normal
status: open
title: python sys.argv argument parsing not clear
type: behavior
versions: Python 2.7, 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



[issue25836] Documentation of MAKE_FUNCTION/MAKE_CLOSURE_EXTENDED_ARG is misleading

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

MAKE_FUNCTION was changed in 3.6, and its documentation was changed 
accordingly. 3.5 is now in security-only fixes stage.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
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



[issue24565] the f_lineno getter is broken

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Could you please convert your patches to a PR Xavier?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue13677] correct docstring for builtin compile

2018-03-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue4819] Misc/cheatsheet needs updating

2018-03-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
status: open -> pending
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue33118] No clean way to get notified when a Transport's write buffer empties out

2018-03-22 Thread Vitaly Kruglikov

New submission from Vitaly Kruglikov :

There doesn't appear to be an ordained mechanism for getting notified when a 
Transport's (or WriteTransport's) write buffer drains to zero (i.e., all output 
data has been transferred to socket). I don't want to hijack 
`set_write_buffer_limits()` for this purpose, because that would preclude me 
from using it for its intended purpose.

I see that transport in selector_events.py has a private method 
`_make_empty_waiter()`, which is along the lines of what I need, but it's 
private and is used by `BaseSelectorEventLoop._sendfile_native()`.

Just like `BaseSelectorEventLoop._sendfile_native()`, my app needs equivalent 
functionality in order to be able to run the loop (`run_until_complete()`) 
until the transport's write buffer empties out.

--
components: asyncio
messages: 314236
nosy: asvetlov, vitaly.krug, yselivanov
priority: normal
severity: normal
status: open
title: No clean way to get notified when a Transport's write buffer empties out
type: enhancement
versions: 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



[issue27212] Doc for itertools, 'islice()' implementation have unwanted behavior for recipe 'consume()'

2018-03-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Cheryl, I think you take this one.  It hasn't been touched in a long time and 
Nofar is focused on another issue.

--
assignee: Nofar Schnider -> csabella

___
Python tracker 

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



[issue33108] Unicode char 304 in lowercase has len = 2

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Ma Lin.

Closed as a duplicate of issue17252.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Latin Capital Letter I with Dot Above

___
Python tracker 

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