[issue33031] Questionable code in OrderedDict definition

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 827d49f3cf0296f1e267eae6834a977cf312cc1e by Serhiy Storchaka in 
branch 'master':
bpo-33031: Remove dead code in C implementation of OrderedDict. (GH-6120)
https://github.com/python/cpython/commit/827d49f3cf0296f1e267eae6834a977cf312cc1e


--

___
Python tracker 

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



[issue31920] pygettext ignores directories as inputfile argument

2018-04-09 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6128

___
Python tracker 

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



[issue31920] pygettext ignores directories as inputfile argument

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset c93938b5beea4c3f592119ebee6d4029558db8de by Serhiy Storchaka in 
branch 'master':
bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. 
(GH-6259)
https://github.com/python/cpython/commit/c93938b5beea4c3f592119ebee6d4029558db8de


--

___
Python tracker 

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



Re: Python Idle not giving my prompt after If line

2018-04-09 Thread Terry Reedy

On 4/9/2018 3:07 AM, Peter Otten wrote:

brg...@gmail.com wrote:


I typed the If part of an If/Else statement, but did not get a prompt at
the beginning of the next line when I hit return. Instead, the cursor
lined up under the "p" of "print." Here is the line of text (it's part of
a longer bit of coding, I copied out of a textbook).


if right_this_minute in odds:

print("This minute seems a little odd.")[Return]

You can't see it, but the cursor is blinking under the "p."

Why is this happening and what's the fix?



It works as designed; the interpreter has no way of knowing whether you are
about to write another line belonging to the if suite, like in

if foo:
print("clearing foo")
foo = False


To enter 'else', instead of another line under 'if', hit backspace.


That's why you have to hit  twice to trigger execution of the code.


When you are done entering the complete multiline statement.


By the way, when you copy (or write) a "longer bit" I recomend that you put
the code into a py file so that you don't have to retype it when you want to
make a small modification. Instead you can just hit F5 and see the effect of
your changes.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


[issue33222] Various test failures if PYTHONUSERBASE is not canonicalized

2018-04-09 Thread Akshay Sharma

Change by Akshay Sharma :


--
keywords: +patch
pull_requests: +6130
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



[issue32759] multiprocessing.Array do not release shared memory

2018-04-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset e4679cd644aa19f9d9df9beb1326625cf2b02c15 by Antoine Pitrou in 
branch 'master':
bpo-32759: Free unused arenas in multiprocessing.heap (GH-5827)
https://github.com/python/cpython/commit/e4679cd644aa19f9d9df9beb1326625cf2b02c15


--

___
Python tracker 

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



[issue32759] multiprocessing.Array do not release shared memory

2018-04-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Yes, it's a minimal effort.  More sophisticated behavior would require a more 
sophisticated allocator.

--

___
Python tracker 

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



[issue33244] Overflow error

2018-04-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Vignesh: This issue tracker is for reporting bugs in the CPython interpreter.  
Requests for help with problems with your code should go elsewhere, such as 
pythonlist mail list or stackoverflow.com web site.

In this case, your problem is described in the error message: you input an int 
that is too large for the array of C longs.  The following is a much shortened 
example equivalent to your code.

>>> import array
>>> longs = array.array('l',[])
>>> longs.append(222)
Traceback (most recent call last):
  File "", line 1, in 
longs.append(222)
OverflowError: Python int too large to convert to C long

When a program gets input from a user, it must be prepared to catch and deal 
with exceptions.  If you have more questions, ask on a user help forum, such as 
the 2 I listed above.

--
assignee: terry.reedy -> 
components:  -IDLE
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



[issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows

2018-04-09 Thread Eryk Sun

Eryk Sun  added the comment:

Your case probably isn't due to a anti-malware filesystem filter. Explorer 
keeps handles open to directories to get updates via ReadDirectoryChangesExW. 
It opens watched directories with shared delete  access, so deleting the child 
succeeds. But as discussed above, the directory isn't unlinked from the parent 
until Explorer closes its handle. Apparently it's not fast enough on the 
systems you tested.

As a workaround, you can define an onerror handler for use with shutil.rmtree() 
that retries the rmdir() call in a loop for up to a given timeout period, such 
as 10 ms. For convenience, a handler that retries unlink() and rmdir() could be 
distributed with shutil. For ease of use, it could be enabled by default on 
Windows.

--

___
Python tracker 

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



[issue32759] multiprocessing.Array do not release shared memory

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This change looks safe to me. I was just not sure that it is enough for 
practical cases. What if after allocating a large buffer the rest of the new 
area would be used for allocating small buffers? They can keep references to 
the large area after freeing the large buffer. Perhaps it is worth to block 
marking the remainder of a large area available. This will increase the memory 
consumption by small percent, but will reduce the risk of prolonging the life 
time of large blocks.

--

___
Python tracker 

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



Re: Python Idle not giving my prompt after If line

2018-04-09 Thread Peter Otten
brg...@gmail.com wrote:

> On Monday, April 9, 2018 at 3:08:28 AM UTC-4, Peter Otten wrote:
>> brg...@gmail.com wrote:
>> 
>> > I typed the If part of an If/Else statement, but did not get a prompt
>> > at the beginning of the next line when I hit return. Instead, the
>> > cursor lined up under the "p" of "print." Here is the line of text
>> > (it's part of a longer bit of coding, I copied out of a textbook).
>> > 
>>  if right_this_minute in odds:
>> >print("This minute seems a little odd.")[Return]
>> > 
>> > You can't see it, but the cursor is blinking under the "p."
>> > 
>> > Why is this happening and what's the fix?
>> > 
>> > Thanks,
>> > 
>> > Tamara
>> 
>> It works as designed; the interpreter has no way of knowing whether you
>> are about to write another line belonging to the if suite, like in
>> 
>> if foo:
>>print("clearing foo")
>>foo = False
>> 
>> That's why you have to hit  twice to trigger execution of the
>> code.
>> 
>> By the way, when you copy (or write) a "longer bit" I recomend that you
>> put the code into a py file so that you don't have to retype it when you
>> want to make a small modification. Instead you can just hit F5 and see
>> the effect of your changes.
> 
> Thanks, Peter, for your quick reply. But here's what happened. When I hit
>  twice, the cursor did go back to the margin, but skipped two
> lines before doing so. Then when I hit  after "else:" I got an
> error message again. What did I do wrong? 

I'm sorry, I did not read your question carefully enough, and missed the 
"else" part. Please read Terry's correction of my advice.

> Also, could you please tell me
> how to create a py file. Thanks.

Choose "New File" in the "File" menu, then write your code in the window 
that pops up, save with "Save" (pick a meaningful name that does not collide 
with any name in Python's standard library) and finally run with "Run 
Module" in the "Run" menu.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33099] test_poplib hangs with the changes done in PR

2018-04-09 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks for you confirmation. I already knew which commit lead to the issue. :)

The problem didn't "pop" up in my local tests or on Travis CI. I can only 
reproduce it locally, when I run the test in a tight loop and put extra load on 
the other CPU cores.

--

___
Python tracker 

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



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-09 Thread Ethan Furman

Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue33099] test_poplib hangs with the changes done in PR

2018-04-09 Thread Skip Montanaro

Skip Montanaro  added the comment:

Just in case this would be useful to others, git bisect led me to this commit 
as the source of the problem:

61d478c71c5341cdc54e6bfb4ace4252852fd972 is the first bad commit
commit 61d478c71c5341cdc54e6bfb4ace4252852fd972
Author: Christian Heimes 
Date:   Sat Jan 27 15:51:38 2018 +0100

bpo-31399: Let OpenSSL verify hostname and IP address (#3462)

bpo-31399: Let OpenSSL verify hostname and IP

The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and
X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses.

* Remove match_hostname calls
* Check for libssl with set1_host, libssl must provide 
X509_VERIFY_PARAM_set1_host()
* Add documentation for OpenSSL 1.0.2 requirement
* Don't support OpenSSL special mode with a leading dot, e.g. 
".example.org" matches "www.example.org". It's not standard conform.
* Add hostname_checks_common_name

Signed-off-by: Christian Heimes 

:04 04 09f4c8a18941f926c1f79e2f07dfd7731edf74c2 
798ae3fab880e3365c490d56935901a4c18fd3bd M  Doc
:04 04 f35a1b4e2144050dfc4c7dbb02b7d92e3de1c2d0 
7af4e4a8e82eafc6e7f2f4392c951213777f12c4 M  Lib
:04 04 e287c27f4db61beae905c21b9194bb930c13 
59e6fc63d296f7fe3187ff0987a04ce2d1d0 M  Misc
:04 04 95250f4c1009b5f10ec392c186908698d78f9cd3 
160ebeb2c63d1ca305c7e37a0b555900b5084d20 M  Modules
:04 04 8adc7f664a8eaa667f4540f537304d7f9de672d4 
41ea621f5433077f6dd776f4c2c51f7a8e4cab0f M  PC
:100644 100644 a6f4488cc99941abaa8b6fb7c53079b7cc292f9f 
ba0a7624cfcd0129e73bc218510f398001514df8 M  setup.py

--
nosy: +skip.montanaro

___
Python tracker 

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



[issue33237] Improve AttributeError message for partially initialized module

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I have applied the Nick's suggestion. Needed to find a place for new test.

The code is copied from PyImport_ImportModuleLevelObject(). I'm not happy from 
how verbose it is. And testing mod.__spec__._initialized adds relatively large 
overhead for importing already imported module in 
PyImport_ImportModuleLevelObject(). Is it possible to invent a faster way for 
checking whether the module is partially imported?

--

___
Python tracker 

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



[issue33222] Various test failures if PYTHONUSERBASE is not canonicalized

2018-04-09 Thread Akshay Sharma

Akshay Sharma  added the comment:

What are the possible cases we can have here ?

--
nosy: +akshaysharma096

___
Python tracker 

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



[issue33200] Optimize the empty set "literal"

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Closed due to the lack of practical applications. Can be reopened if this idiom 
become popular.

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



[issue31920] pygettext ignores directories as inputfile argument

2018-04-09 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6127

___
Python tracker 

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



[issue33249] Unpickling objects with recursive references and partials fail due to incomplete state passed to __setstate__

2018-04-09 Thread Alexander Neumann

Alexander Neumann  added the comment:

Changed issue title to summarise the actual problem better.

--
title: Pickling objects with recursive references and partials fail -> 
Unpickling objects with recursive references and partials fail due to 
incomplete state passed to __setstate__

___
Python tracker 

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



[issue32759] multiprocessing.Array do not release shared memory

2018-04-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I pushed a fix for this in 3.8.  Since the fix is a bit delicate, I'd rather 
not backport it.  Thank you for reporting this issue!

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



Re: Python Idle not giving my prompt after If line

2018-04-09 Thread brgrt2
On Monday, April 9, 2018 at 3:08:28 AM UTC-4, Peter Otten wrote:
> brg...@gmail.com wrote:
> 
> > I typed the If part of an If/Else statement, but did not get a prompt at
> > the beginning of the next line when I hit return. Instead, the cursor
> > lined up under the "p" of "print." Here is the line of text (it's part of
> > a longer bit of coding, I copied out of a textbook).
> > 
>  if right_this_minute in odds:
> >print("This minute seems a little odd.")[Return]
> > 
> > You can't see it, but the cursor is blinking under the "p."
> > 
> > Why is this happening and what's the fix?
> > 
> > Thanks,
> > 
> > Tamara
> 
> It works as designed; the interpreter has no way of knowing whether you are 
> about to write another line belonging to the if suite, like in
> 
> if foo:
>print("clearing foo")
>foo = False
> 
> That's why you have to hit  twice to trigger execution of the code.
> 
> By the way, when you copy (or write) a "longer bit" I recomend that you put 
> the code into a py file so that you don't have to retype it when you want to 
> make a small modification. Instead you can just hit F5 and see the effect of 
> your changes.

Thanks, Peter, for your quick reply. But here's what happened. When I hit 
 twice, the cursor did go back to the margin, but skipped two lines 
before doing so. Then when I hit  after "else:" I got an error message 
again. What did I do wrong? 
Also, could you please tell me how to create a py file. Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33031] Questionable code in OrderedDict definition

2018-04-09 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6129

___
Python tracker 

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



[issue33245] Unable to send CTRL_BREAK_EVENT

2018-04-09 Thread Eryk Sun

Eryk Sun  added the comment:

Unless you're willing to step through hoops using ctypes or PyWin32, sending 
Ctrl+Break requires already being attached to the same console as the target. 
Note that the target isn't necessarily a single process that's attached to the 
console. Sending a control event is implemented by calling WinAPI 
GenerateConsoleCtrlEvent, which targets process group identifiers (i.e. like 
Unix killpg), not process identifiers (i.e. not like Unix kill). 

FYI, to generate the event, the console host (conhost.exe) uses an LPC port to 
relay the request to the session Windows server (csrss.exe), which is 
privileged to inject a thread in each target process. This control thread 
starts executing at a known entry point named "CtrlRoutine" in kernelbase.dll. 
(Prior to Windows 7 the console is actually hosted in csrss.exe, so there's no 
need to relay the request, and "CtrlRoutine" is implemented in kernel32.dll 
instead.)

If you don't know the group ID, then the only option is to broadcast Ctrl+Break 
to group 0, which includes every process that's attached to the console. First 
ignore SIGBREAK (the C signal for CTRL_BREAK_EVENT) via 
signal.signal(signal.SIGBREAK, signal.SIG_IGN). Otherwise the default handler 
will run, which exits the current process. Then send Ctrl+Break via os.kill(0, 
signal.CTRL_BREAK_EVENT). 

On the other hand, if you started the process as a new group, then its ID is 
also the group ID. For example, p = subprocess.Popen('vault.exe', 
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP). In this case you can   send 
Ctrl+Break via os.kill(p.pid, signal.CTRL_BREAK_EVENT). Windows will generate 
the event only in the subset of processes that are both in the target process 
group and currently attached to the console that originated the request.

The current implementation of os.kill() is behaving as designed and documented 
in Python 2.7. There is no bug in this case. However, the docs should clarify 
that the target when sending a console control event is a process group, not a 
process. They should also refer to the subprocess docs to explain how to create 
a new group via the CREATE_NEW_PROCESS_GROUP creation flag. Also, the line 
about accepting process handles should be stricken. A process handle is an 
integer that's indistinguishable from a process/group identifier, so the 
statement makes no sense, and thankfully the code doesn't try to implement 
anything that crazy.

In Python 3, someone decided that if GenerateConsoleCtrlEvent fails, os.kill() 
should also try TerminateProcess, to allow terminating the process explicitly 
with exit codes 0 (CTRL_C_EVENT) and 1 (CTRL_BREAK_EVENT). Of course, killing a 
process using a console control event is nothing at all like terminating it 
abruptly, so to me this looks quite strange; it's coding with a sledgehammer. 
Anyway, if TerminateProcess succeeds it should, but currently does not, clear 
the error from the failed GenerateConsoleCtrlEvent call. That's a bug.

I suggest resolving the bug by partially backing out of the change. It should 
only call GenerateConsoleCtrlEvent for the enum values signal.CTRL_C_EVENT and 
signal.CTRL_BREAK_EVENT, which I think was suggested by Steve Dower at one 
point. TerminateProcess can be called otherwise for 0 and 1 values. In this 
case, os.kill() would no longer magically switch between fundamentally 
different functions in a single call. An exception should always be raised if 
GenerateConsoleCtrlEvent fails. Possibly in 3.8, os.killpg() could be added on 
Windows for sending console control events to process groups, while deprecating 
or discouraging using os.kill() for this.

--
nosy: +eryksun
versions: +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



[issue31920] pygettext ignores directories as inputfile argument

2018-04-09 Thread miss-islington

miss-islington  added the comment:


New changeset 9b25bd6e26b50ade8d52a85c78d957b1f6f9131c by Miss Islington (bot) 
in branch '3.7':
bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. 
(GH-6259)
https://github.com/python/cpython/commit/9b25bd6e26b50ade8d52a85c78d957b1f6f9131c


--
nosy: +miss-islington

___
Python tracker 

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



[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2018-04-09 Thread David K. Hess

David K. Hess  added the comment:

Are there any committers watching this issue that are able to review the PR?

https://github.com/python/cpython/pull/3062

It's close to 6 months old now with no action on it. I'm willing to help but 
doing so and then having the PR gather dust is pretty discouraging.

Thanks in advance!

--

___
Python tracker 

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



[issue33031] Questionable code in OrderedDict definition

2018-04-09 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



[issue33031] Questionable code in OrderedDict definition

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b0f387d7ca126d486fc82744b8ec90c131230311 by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-33031: Remove dead code in C implementation of OrderedDict. (GH-6120) 
(GH-6433)
https://github.com/python/cpython/commit/b0f387d7ca126d486fc82744b8ec90c131230311


--

___
Python tracker 

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



[issue32706] test_check_hostname() of test_ftplib started to fail randomly

2018-04-09 Thread Fred L. Drake, Jr.

Change by Fred L. Drake, Jr. :


--
nosy: +fdrake

___
Python tracker 

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



[issue33099] test_poplib hangs with the changes done in PR

2018-04-09 Thread Skip Montanaro

Skip Montanaro  added the comment:

@christian.heimes I figured you probably didn't need it, but I did that work 
before I discovered this ticket. And as a nice bonus, I got to learn git 
bisect. :-)

--

___
Python tracker 

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



[issue33251] ConfigParser.items returns items present in vars

2018-04-09 Thread Tim Shaffer

New submission from Tim Shaffer :

The documentation for ConfigParser.items(section, raw=False, vars=None) says 
the following:

> Changed in version 3.2: Items present in vars no longer appear in the result. 
> The previous behaviour mixed actual parser options with variables provided 
> for interpolation.

https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.items

However, this does not seem to be the case. The keys from vars are present in 
the output. Tested on 3.6.5.

This example shows the issue:

import configparser

config = configparser.ConfigParser()

config.add_section('example')
config.set('example', 'name', 'timster %(suffix)s')

data = config.items('example', vars={'suffix': 'user'})

print(data)


Expected output:

[('name', 'timster user')]

Actual output:

[('name', 'timster user'), ('suffix', 'user')]

--
components: Library (Lib)
messages: 315148
nosy: timster
priority: normal
severity: normal
status: open
title: ConfigParser.items returns items present in vars
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



[issue33251] ConfigParser.items returns items present in vars

2018-04-09 Thread Tim Shaffer

Change by Tim Shaffer :


--
type:  -> behavior

___
Python tracker 

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



[issue12345] Add math.tau

2018-04-09 Thread Pokestar Fan

Change by Pokestar Fan :


--
pull_requests: +6132

___
Python tracker 

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



[issue16974] when "python -c command" does a traceback, it open the file ""

2018-04-09 Thread Ned Deily

Change by Ned Deily :


--
stage:  -> needs patch
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.2, Python 3.3, Python 
3.4

___
Python tracker 

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



[issue31201] make test: module test that failed doesn't exist

2018-04-09 Thread Ned Deily

Ned Deily  added the comment:


New changeset 0f914b5b5f6ba186afd7112fc851c97247076f70 by Ned Deily (Aaron Ang) 
in branch 'master':
bpo-31201: Clarify command to re-run failing test(s) with example (GH-6417)
https://github.com/python/cpython/commit/0f914b5b5f6ba186afd7112fc851c97247076f70


--
nosy: +ned.deily

___
Python tracker 

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



[issue31201] make test: module test that failed doesn't exist

2018-04-09 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6133

___
Python tracker 

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



[issue31201] make test: module test that failed doesn't exist

2018-04-09 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6134

___
Python tracker 

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



[issue31201] make test: module test that failed doesn't exist

2018-04-09 Thread Ned Deily

Ned Deily  added the comment:


New changeset 71a3837bf39580ffa828c14247230a9277b9d5b1 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
[3.7] bpo-31201: Clarify command to re-run failing test(s) with example 
(GH-6417) (GH-6437)
https://github.com/python/cpython/commit/71a3837bf39580ffa828c14247230a9277b9d5b1


--

___
Python tracker 

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



[issue31201] make test: module test that failed doesn't exist

2018-04-09 Thread Ned Deily

Ned Deily  added the comment:


New changeset 83bb39907ec3828aec6d99bb9338283bd6b30ac2 by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31201: Clarify command to re-run failing test(s) with example 
(GH-6417) (GH-6438)
https://github.com/python/cpython/commit/83bb39907ec3828aec6d99bb9338283bd6b30ac2


--

___
Python tracker 

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



[issue31201] make test: module test that failed doesn't exist

2018-04-09 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the PR, Aaron!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue33252] Clarify ResourceWarning documentation

2018-04-09 Thread Ed Morley

New submission from Ed Morley :

The `ResourceWarning` warning has always been ignored by default, since it was 
added in Python 3.2 in:
https://github.com/python/cpython/commit/08be72d0aa0112118b79d271479598c218adfd23#diff-db4e2b9efea108a38c53e06fa99cdd77R391

However there are several places in the docs where the "ignored by default" 
aspect is not mentioned even though it is for `DeprecationWarning` and similar 
- which caused me quite a bit of confusion today.

The docs were partly improved in Python 3.7 onwards by:
https://github.com/python/cpython/commit/9b99747386b690007027c3be2a5d7cfe3d3634f5

...however:
(a) there is still at least one place that still needs updating on master 
(https://docs.python.org/3.8/library/warnings.html#warning-categories)
(b) it would be good to backport the docs fixes to 3.4/3.5/3.6 (I was looking 
at the 3.6 docs today)

I'm happy to open PRs to fix this; but filing this issue so I have something to 
reference.

--
assignee: docs@python
components: Documentation
messages: 315153
nosy: docs@python, edmorley
priority: normal
severity: normal
status: open
title: Clarify ResourceWarning documentation
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



[issue33253] xxsubtype.bench does not function correctly on CPython 3+

2018-04-09 Thread Gorialis

New submission from Gorialis :

Due to the `OS|i` signature of `xxsubtype.bench`, it accepts `bytes` as its 
second argument in CPython 3+, however, it does a call `PyObject_GetAttr` which 
only accepts `PyString`.

This means that if you give the function `bytes`, it fails on the getattr call, 
but if you give it anything else, it rejects it as it doesn't match the 
signature.

While the module itself does not contribute to CPython's functionality (and is 
infact optional), since it serves as an example, it should actually function, 
as it does in CPython 2.

--
components: Extension Modules
messages: 315154
nosy: Gorialis
priority: normal
severity: normal
status: open
title: xxsubtype.bench does not function correctly on CPython 3+
type: behavior
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



[issue33253] xxsubtype.bench does not function correctly on CPython 3+

2018-04-09 Thread Gorialis

Change by Gorialis :


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

___
Python tracker 

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



[issue33254] importlib.resources.contents() incorrectly yields an empty list

2018-04-09 Thread Brett Cannon

New submission from Brett Cannon :

If you look at 
https://github.com/python/cpython/blob/0f914b5b5f6ba186afd7112fc851c97247076f70/Lib/importlib/resources.py#L247
 you will notice that the generator for importlib.resources.contents() return 
an empty list. While the intent was to have no values be returned by 
contents(), by virtue of being a generator that empty list is actually being 
returned as a value.

--
assignee: brett.cannon
components: Library (Lib)
messages: 315155
nosy: barry, brett.cannon
priority: normal
severity: normal
stage: test needed
status: open
title: importlib.resources.contents() incorrectly yields an empty list
type: behavior
versions: 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



[issue33254] importlib.resources.contents() incorrectly yields an empty list

2018-04-09 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Note that this is in the case where a user is asking for the contents of a 
namespace package (which by definition, can't have resources).

+1 on fixing this API wart.  

Will you @brett.cannon will submit a PR?  I'll do a quick review and then 
backport the change to the standalone library.

--

___
Python tracker 

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



[issue33248] __await__ behaves different with or without PYTHONASYNCIODEBUG

2018-04-09 Thread Jonas Obrist

Jonas Obrist  added the comment:

I realized I have to call __await__ of the inner coroutine object in 
NonTrueAwaitable.__await__. This is not a bug, but my mistake.

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



[issue32823] Regression in test -j behavior and time in 3.7.0b1

2018-04-09 Thread Zachary Ware

Zachary Ware  added the comment:

Ok, interesting.  The above results are from running on my Windows 8.1 
buildbot, running on Azure.  Running on a local fully-updated (I think) Windows 
10 VM, I get results similar to what Terry reports: results come in batches of 
X for -jX.  Does anyone know of any changes we've made that would cause Windows 
10 to behave differently here, or has something changed in Windows itself to 
cause the issue?

Steve or Eryk, do you get the same?

--
nosy: +eryksun

___
Python tracker 

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



Re: Python Idle not giving my prompt after If line

2018-04-09 Thread T Berger
On Monday, April 9, 2018 at 1:34:04 PM UTC-4, Peter Otten wrote:
> brg...@gmail.com wrote:
> 
> > On Monday, April 9, 2018 at 3:08:28 AM UTC-4, Peter Otten wrote:
> >> brg...@gmail.com wrote:
> >> 
> >> > I typed the If part of an If/Else statement, but did not get a prompt
> >> > at the beginning of the next line when I hit return. Instead, the
> >> > cursor lined up under the "p" of "print." Here is the line of text
> >> > (it's part of a longer bit of coding, I copied out of a textbook).
> >> > 
> >>  if right_this_minute in odds:
> >> >print("This minute seems a little odd.")[Return]
> >> > 
> >> > You can't see it, but the cursor is blinking under the "p."
> >> > 
> >> > Why is this happening and what's the fix?
> >> > 
> >> > Thanks,
> >> > 
> >> > Tamara
> >> 
> >> It works as designed; the interpreter has no way of knowing whether you
> >> are about to write another line belonging to the if suite, like in
> >> 
> >> if foo:
> >>print("clearing foo")
> >>foo = False
> >> 
> >> That's why you have to hit  twice to trigger execution of the
> >> code.
> >> 
> >> By the way, when you copy (or write) a "longer bit" I recomend that you
> >> put the code into a py file so that you don't have to retype it when you
> >> want to make a small modification. Instead you can just hit F5 and see
> >> the effect of your changes.
> > 
> > Thanks, Peter, for your quick reply. But here's what happened. When I hit
> >  twice, the cursor did go back to the margin, but skipped two
> > lines before doing so. Then when I hit  after "else:" I got an
> > error message again. What did I do wrong? 
> 
> I'm sorry, I did not read your question carefully enough, and missed the 
> "else" part. Please read Terry's correction of my advice.
> 
> > Also, could you please tell me
> > how to create a py file. Thanks.
> 
> Choose "New File" in the "File" menu, then write your code in the window 
> that pops up, save with "Save" (pick a meaningful name that does not collide 
> with any name in Python's standard library) and finally run with "Run 
> Module" in the "Run" menu.

Thanks, Peter, for your help. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Idle not giving my prompt after If line

2018-04-09 Thread T Berger
On Monday, April 9, 2018 at 1:19:13 PM UTC-4, Terry Reedy wrote:
> On 4/9/2018 3:07 AM, Peter Otten wrote:
> > brg...@gmail.com wrote:
> > 
> >> I typed the If part of an If/Else statement, but did not get a prompt at
> >> the beginning of the next line when I hit return. Instead, the cursor
> >> lined up under the "p" of "print." Here is the line of text (it's part of
> >> a longer bit of coding, I copied out of a textbook).
> >>
> > if right_this_minute in odds:
> >> print("This minute seems a little odd.")[Return]
> >>
> >> You can't see it, but the cursor is blinking under the "p."
> >>
> >> Why is this happening and what's the fix?
> 
> > It works as designed; the interpreter has no way of knowing whether you are
> > about to write another line belonging to the if suite, like in
> > 
> > if foo:
> > print("clearing foo")
> > foo = False
> 
> To enter 'else', instead of another line under 'if', hit backspace.
> 
> > That's why you have to hit  twice to trigger execution of the code.
> 
> When you are done entering the complete multiline statement.
> 
> > By the way, when you copy (or write) a "longer bit" I recomend that you put
> > the code into a py file so that you don't have to retype it when you want to
> > make a small modification. Instead you can just hit F5 and see the effect of
> > your changes.
> 
> -- 
> Terry Jan Reedy

Thanks, Terry, for your help. 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31920] pygettext ignores directories as inputfile argument

2018-04-09 Thread miss-islington

miss-islington  added the comment:


New changeset e0dbc57e116516f6ca1ef021f71e1a98773d57ed by Miss Islington (bot) 
in branch '3.6':
bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. 
(GH-6259)
https://github.com/python/cpython/commit/e0dbc57e116516f6ca1ef021f71e1a98773d57ed


--

___
Python tracker 

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



[issue31920] pygettext ignores directories as inputfile argument

2018-04-09 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6131

___
Python tracker 

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



How to apply filters to posts

2018-04-09 Thread T Berger
This is the first time I've joined a google group and I don't understand the 
setup. Why are most of the posts in this group unrelated to python, and how do 
I filter this junk (sorry) out? 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to apply filters to posts

2018-04-09 Thread Chris Angelico
On Tue, Apr 10, 2018 at 3:10 PM, T Berger  wrote:
> This is the first time I've joined a google group and I don't understand the 
> setup. Why are most of the posts in this group unrelated to python, and how 
> do I filter this junk (sorry) out?
>

Probably most of them ARE junk. Google Groups has a lot of spam in it.
I recommend, instead, joining the mailing list:

https://mail.python.org/mailman/listinfo/python-list

Other people recommend Gmane, which is also a highly viable option.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32576] concurrent.futures.thread deadlock due to Queue in weakref callback

2018-04-09 Thread devurandom

Change by devurandom :


--
nosy: +devurandom

___
Python tracker 

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



[issue21009] Potential deadlock in concurrent futures when garbage collection occurs during Queue.get

2018-04-09 Thread devurandom

Change by devurandom :


--
nosy: +devurandom

___
Python tracker 

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



Filtering computer.lang.python

2018-04-09 Thread T Berger
This is the first time I've joined a google group and I don't understand the 
setup. Why are most of the posts in this group unrelated to python, and how do 
I filter this junk (sorry) out?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33253] xxsubtype.bench does not function correctly on CPython 3+

2018-04-09 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6136

___
Python tracker 

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



[issue33253] xxsubtype.bench does not function correctly on CPython 3+

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset f178028f37c9dafb72608b719eb03e5a70af4ff5 by Serhiy Storchaka 
(Devon R) in branch 'master':
bpo-33253: Fix xxsubtype.bench() to accept correct str signature. (GH-6439)
https://github.com/python/cpython/commit/f178028f37c9dafb72608b719eb03e5a70af4ff5


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33253] xxsubtype.bench does not function correctly on CPython 3+

2018-04-09 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6137

___
Python tracker 

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



[issue33099] test_poplib hangs with the changes done in PR

2018-04-09 Thread Christian Heimes

Christian Heimes  added the comment:

This is likely a duplicate of BPO #32706 and #32753

--
nosy: +christian.heimes

___
Python tracker 

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



[issue33099] test_poplib hangs with the changes done in PR

2018-04-09 Thread INADA Naoki

INADA Naoki  added the comment:

@Christian

Precisely, my PR doesn't fix #32706 and #32753.
It fixes only hang caused by them and print stack trace for them.

--

___
Python tracker 

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



Leo 5.7.1 Released

2018-04-09 Thread Edward K. Ream
Leo 5.7.1, http://leoeditor.com, is now available on [GitHub](
https://github.com/leo-editor/leo-editor).

Leo is an IDE, outliner and PIM, as described [here](
http://leoeditor.com/preface.html).

**The highlights of Leo 5.7.1**

- Improved support for themes, including the open-theme-file command.
- Added --theme= command-line option.
- Added @string theme-name setting.
- Leo warns if stylesheets contain undefined @-constants.
- Replaced 5 vs-* commands by corresponding eval* commands.
- Support @file x.md using html sentinels.
- Allow @path in @ nodes, and optionally generate same in recursive
imports.
- Improved menus.
- The usual minor bug fixes.

**Links**

- Leo's home page: http://leoeditor.com
- [Documentation](http://leoeditor.com/leo_toc.html)
- [Tutorials](http://leoeditor.com/tutorial.html)
- [Video tutorials](http://leoeditor.com/screencasts.html)
- [Forum](http://groups.google.com/group/leo-editor)
- [Download](http://sourceforge.net/projects/leo/files/)
- [Leo on GitHub](https://github.com/leo-editor/leo-editor)
- [LeoVue](https://github.com/kaleguy/leovue#leo-vue)
- [What people are saying about Leo](http://leoeditor.com/testimonials.html)
- [A web page that displays .leo files](http://leoeditor.com/load-leo.html)
- [More links](http://leoeditor.com/leoLinks.html)

Edward
--
Edward K. Ream: edream...@gmail.com Leo: http://leoeditor.com/
--
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue33099] test_poplib hangs with the changes done in PR

2018-04-09 Thread INADA Naoki

INADA Naoki  added the comment:

There are some resource leaks:

* When error occurred in setUp() function, server thread is not stopped.  It 
leaked threads and sockets for the server.
* When error occurred in server thread's run() method, asyncore.close_all() is 
not called.

These leaks makes dangling threads.  It caused hang in test_poplib shutdown 
process.

Additionally, the error is not printed in these cases.  It makes harder to fix 
real problem.

--
nosy: +inada.naoki
stage: patch review -> 

___
Python tracker 

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



[issue33248] Different behavior on macos and linux (docker) with __await__

2018-04-09 Thread Jonas Obrist

New submission from Jonas Obrist :

The attached code runs fine on MacOS using 3.6.5 from homebrew. However on 
Windows (I tested on 3.6.4 with the 32bit installer from the website) and Linux 
(using the python:3.6.5 docker image) it errors with "TypeError: cannot 'yield 
from' a coroutine object in a non-coroutine generator".

On MacOS I tried both _UnixSelectorEventLoop with Kqueue and Select selectors, 
on Linux _UnixSelectorEventLoop with Epoll and Select.

Which behavior is the expected one?

As an aside, what I'm trying to achieve is to have an awaitable object that 
which if unawaited evaluates to False if used in if statements.

--
components: asyncio
files: nta.py
messages: 315119
nosy: Jonas Obrist, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Different behavior on macos and linux (docker) with __await__
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47526/nta.py

___
Python tracker 

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



Python-based LUM shell released

2018-04-09 Thread CJS Hayward
https://github.com/CJSHayward/psh

A revamped version of an unofficial Python Shell ("psh") , an experimental 
shell intended to bring more power and expert-friendly UX to the Linux / Unix / 
Mac command line, has been released. Its main focus is to be an interactive 
command line shell that will let you use Python as the shell's (native) 
scripting language. It has other experimental niceties; for instance, you are 
not required to type a command when a command is obvious. If you give a 
directory name, it will change directory to that directory (an old-fashioned 
"ls" will still list the directory). If you type the name of a source file in 
the current directory (or current directory heirarchy!) it will pull it up in 
the editor. (You can circumvent this behavior by prefacing standard commands by 
"run"). The code is written to read like plain English and be hacker-friendly, 
and patches are of course welcome!

(Slashdot submission at 
https://slashdot.org/submission/8078275/python-powered-linux--unix--mac-command-line-shell-released;
 please upvote if desired.)

C.J.S. Hayward
https://CJSHayward.com
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue33099] test_poplib hangs with the changes done in PR

2018-04-09 Thread INADA Naoki

Change by INADA Naoki :


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

___
Python tracker 

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



[issue33248] __await__ behaves different with or without PYTHONASYNCIODEBUG

2018-04-09 Thread Jonas Obrist

Jonas Obrist  added the comment:

I've just realized the difference between the environments wasn't the operating 
system, but PYTHONASYNCIODEBUG. If it is set, the code works, however if it is 
unset the code does not work. See the updated (attached) code for reference.

--
title: Different behavior on macos and linux (docker) with __await__ -> 
__await__ behaves different with or without PYTHONASYNCIODEBUG
Added file: https://bugs.python.org/file47527/nta.py

___
Python tracker 

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



[issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows

2018-04-09 Thread Yu Liu

Yu Liu  added the comment:

This time I run it a couple of consecutive times manually. The result shows 
that the first time it retried 12 times and the wait time was 
0.0004259171330071893. Then it seems to be steady, and the num_retried is 3 or 
4, and the wait_time is about 0.00025.

I also run it without `bar` opened in Explorer. The num_retried is 0 and the 
wait_time is 4.46745114706336e-05.

Because of some reasons, I can't post the exact results here. I will run it on 
another computer later and post the results if you need all of the exact 
results.

--

___
Python tracker 

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



[issue33246] Note in 18.2. json — JSON encoder and decoder is incorrect

2018-04-09 Thread Markus Järvisalo

New submission from Markus Järvisalo :

The note in https://docs.python.org/2/library/json.html section "18.2. json — 
JSON encoder and decoder".

The note says incorrectly that JSON is a subset of YAML 1.2 but if you follow 
the text written in YAML 1.2 specification it states that:

"The primary objective of this revision is to bring YAML into compliance with 
JSON as an official subset."

So it should be that YAML is a subset of JSON and not the other way around.

--
assignee: docs@python
components: Documentation
messages: 315111
nosy: Markus Järvisalo, docs@python
priority: normal
severity: normal
status: open
title: Note in 18.2. json — JSON encoder and decoder is incorrect
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue33247] File "" is opened and read unconditionally

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is a duplicate of issue16974.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> when "python -c command" does a traceback, it open the file 
""

___
Python tracker 

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



[issue33243] nltk is not working properly

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

nltk is not a part of the stdlib, it a third-party library.

But in this case seems the problem is in your code or configuration. Your 
"C:\Users\Ali Abbas\Desktop\token\token.py" file hides the standard token 
module.

--
nosy: +serhiy.storchaka
resolution:  -> third party
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



[issue33244] Overflow error

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Please provide your code and the description of your problem as plain text.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23403] Use pickle protocol 4 by default?

2018-04-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Shelve still uses protocol 3 by default. Should it be bumped too?

That sounds reasonable.  Perhaps open a separate issue for it?

--

___
Python tracker 

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



Re: Python Idle not giving my prompt after If line

2018-04-09 Thread Peter Otten
brg...@gmail.com wrote:

> I typed the If part of an If/Else statement, but did not get a prompt at
> the beginning of the next line when I hit return. Instead, the cursor
> lined up under the "p" of "print." Here is the line of text (it's part of
> a longer bit of coding, I copied out of a textbook).
> 
 if right_this_minute in odds:
>print("This minute seems a little odd.")[Return]
> 
> You can't see it, but the cursor is blinking under the "p."
> 
> Why is this happening and what's the fix?
> 
> Thanks,
> 
> Tamara

It works as designed; the interpreter has no way of knowing whether you are 
about to write another line belonging to the if suite, like in

if foo:
   print("clearing foo")
   foo = False

That's why you have to hit  twice to trigger execution of the code.

By the way, when you copy (or write) a "longer bit" I recomend that you put 
the code into a py file so that you don't have to retype it when you want to 
make a small modification. Instead you can just hit F5 and see the effect of 
your changes.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33246] Note in 18.2. json — JSON encoder and decoder is incorrect

2018-04-09 Thread INADA Naoki

INADA Naoki  added the comment:

> "The primary objective of this revision is to bring YAML into compliance with 
> JSON as an official subset."
>
> So it should be that YAML is a subset of JSON and not the other way around.

This sentence can be read as "JSON is subset of YAML" and "YAML is subset of 
JSON".
As reading the spec, it means former.

For example, http://yaml.org/spec/1.2/spec.html#id2759572 says:

> YAML can therefore be viewed as a natural superset of JSON, offering improved 
> human readability and a more complete information model. This is also the 
> case in practice; every JSON file is also a valid YAML file. This makes it 
> easy to migrate from JSON to YAML if/when the additional features are 
> required.

--
nosy: +inada.naoki
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



[issue33247] File "" is opened and read unconditionally

2018-04-09 Thread Sławomir Nizio

New submission from Sławomir Nizio :

This may lead to e.g. DoS or data leak.

When an exception occurs, the Python interpreter displays the stack trace:

$ python3 a.py
Traceback (most recent call last):
  File "a.py", line 2, in 
print(1/0)
ZeroDivisionError: division by zero

and does so also when there is no source file:

$ python3 -c 'print(1/0)'
Traceback (most recent call last):
  File "", line 1, in 
ZeroDivisionError: division by zero

It opens the file in question to read the needed bits, and an the latter
case it tries to open file named literally .

There is a possibility of a denial of service (a), data leak (b) and
other types of problems (c).

a) If "" is a symbolic link for example to /dev/stdin or an
"empty" fifo, the script hangs.

$ ln -s /dev/stdin ''
$ python3 -c 'print(1/0)'
Traceback (most recent call last):
  File "", line 1, in 

# hangs here

b) If  is a symbolic link, its content will be read as well.
This can be a file with some kind of secret data, readable by the user
executing the script, but which should not be normally displayed to
screen (or for example sent back with HTTP to display the error message).

User who can run a certain script (for example using sudo) that calls
python -c as root or other user may be able to see parts of otherwise
inaccessible files.

c) Other attacks (or misbehaviour) is possible, for example file
 could be a symbolic link to a device file which upon reading
triggers some system wide action.

An interesting possiblity (if not necessarity a security issue by
itself) is a way to trick a user about the cause of the exception, like
in the example.

$ echo 'print(0/1)' > ''
$ python3 -c 'print(1/0)'
Traceback (most recent call last):
  File "", line 1, in 
print(0/1)
ZeroDivisionError: division by zero




As it turns out, the file doesn't need to be in the current directory
but anywhere in sys.path.

I was able to confirm the behaviour on all versions I tried: 2.7.14,
3.5.4 and 3.6.5.


This is in a way similar to the problem with Python modules loaded from
current working directory:
https://bugs.python.org/issue16202 (sys.path[0] security issues)
but the essential differences are that:
- upon validation system (e.g. a server) may reject Python files but
leave out ","
- system can sanitize sys.path which helps with the sys.path[0] bug but
not the one being described.

--
components: Interpreter Core
messages: 315113
nosy: snizio
priority: normal
severity: normal
status: open
title: File "" is opened and read unconditionally
type: security

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-04-09 Thread Siddhesh Poyarekar

Siddhesh Poyarekar  added the comment:

Fair enough, I'll reduce my scope of changes for this patchset, especially 
since I'm unable to find enough time to work on the remaining changes I had 
thought of in the coming weeks.

I'll post an updated patch soonish.

--

___
Python tracker 

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



[issue32753] ssl.SSLError exceptions in test_poplib

2018-04-09 Thread INADA Naoki

INADA Naoki  added the comment:

On Ubuntu 17.10 (OpenSSL 1.0.2g), this patch fixes test_poplib error.
But I don't know this patch is right.

$ git diff
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
index 6abdc93879..d7a8857b05 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -180,7 +180,8 @@ class DummyPOP3Handler(asynchat.async_chat):
 elif err.args[0] == ssl.SSL_ERROR_EOF:
 return self.handle_close()
 # TODO: SSLError does not expose alert information
-elif "SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1]:
+elif ("SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1]
+or "SSLV3_ALERT_CERTIFICATE_UNKNOWN" in err.args[1]):
 return self.handle_close()
 raise
 except OSError as err:

--
nosy: +inada.naoki

___
Python tracker 

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



[issue26979] The danger of PyType_FromSpec()

2018-04-09 Thread Nick Coghlan

Change by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows

2018-04-09 Thread Yu Liu

Yu Liu  added the comment:

These are results on another slower machine. Note these results are attained on 
Windows 10, while the above on Windows 7. Just in case it has some influence.

$ python test.py
num_retries: 6
wait_time: 0.0008691726957804373
$ python test.py
num_retries: 3
wait_time: 0.0007175661796639806
$ python test.py
num_retries: 6
wait_time: 0.0007962191842657514
$ python test.py
num_retries: 3
wait_time: 0.0006970480045504753
$ python test.py
num_retries: 4
wait_time: 0.0009637842810260455
$ python test.py
num_retries: 4
wait_time: 0.001005390580561765
$ python test.py
num_retries: 3
wait_time: 0.000654301806397339
$ python test.py
num_retries: 6
wait_time: 0.0008857012257329832
$ python test.py
num_retries: 4
wait_time: 0.0009227479307990348
$ python test.py
num_retries: 4
wait_time: 0.0008976701612158615

And this is result without `bar` opened in Explorer.

$ python test.py
num_retries: 0
wait_time: 0.00019834235943055225

--

___
Python tracker 

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



[issue26979] The danger of PyType_FromSpec()

2018-04-09 Thread Petr Viktorin

Change by Petr Viktorin :


--
nosy: +Dormouse759, encukou

___
Python tracker 

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



[issue15727] PyType_FromSpecWithBases tp_new bugfix

2018-04-09 Thread Petr Viktorin

Change by Petr Viktorin :


--
nosy: +Dormouse759

___
Python tracker 

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



[issue33248] __await__ behaves different with or without PYTHONASYNCIODEBUG

2018-04-09 Thread Jonas Obrist

Jonas Obrist  added the comment:

On 9c463ec88ba21764f6fff8e01d6045a932a89438 (master/3.7) both cases fail to 
execute. I would argue that this code should be allowed...

--

___
Python tracker 

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



Re: pip problems

2018-04-09 Thread Thomas Jollans
On 2018-04-08 02:45, Anton Alley wrote:
> (I am on Windows 10) When I install a new Python version, pip does not
> update all of the way. In the command line 'pip' still runs the old
> pip.exe, so I've had to manually move the new pip to C:\Windows .

Was there a pip.exe in C:\Windows? That doesn't sound right!

> It would be great if you fixed this for future python versions!
> 
Does running "python" from the command line give you the right version?
I expect it's just a matter of the Pythons being installed side-by-side
and the old version taking precedence in the PATH.

Having multiple Python versions side-by-side can be a bit difficult at
times. I gather the standard advice on Windows is to call "py -3.6 -m
pip" and so on instead of "pip" most of the time, just to be sure.

Perhaps the Python installer should have an option to remove old Pythons
from the PATH. Maybe it does. I wouldn't know.

-- Thomas
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33249] Pickling objects with recursive references and partials fail

2018-04-09 Thread Alexander Neumann

New submission from Alexander Neumann :

The code below causes a 

   AttributeError: 'Event' object has no attribute 'name'

It seems like the entries of `Machine.events` are not available during 
`__setstate__`. However, the behaviour depends on the Python version.

For Python 3.6.4 it's always the 'first' (as in it's always 'to_A' which has 
been added first) element in `Machine.events` that is incomplete. For Python 
3.4.8 and 3.5.5 it looks like a racing condition since sometimes there is no 
error, sometimes its the first or the second element which is incomplete.
Letting `Machine` serve as its own model and pickling that does work for all 
three versions.

Tested on MacOS High Sierra.

```
import pickle
from functools import partial


class Event:

def __init__(self, name, machine):
self.name = name
self.machine = machine

def trigger(self):
pass


class Machine:

def __init__(self, model, states):
self.events = {}
self.model = model if model != 'self' else self

for state in states:
trigger = 'to_%s' % state
self.events[trigger] = Event(trigger, self)
trig_func = partial(self.events[trigger].trigger)
setattr(self.model, trigger, trig_func)

def __getstate__(self):
return self.__dict__

def __setstate__(self, state):
self.__dict__.update(state)
print(self.events['to_B'].name)
print(self.events['to_A'].name)


class Model:

def __init__(self):
self.machine = Machine(self, states=['A', 'B'])

model = Model()
dump = pickle.dumps(model)
model2 = pickle.loads(dump)
```

--
components: Interpreter Core
messages: 315127
nosy: aleneum
priority: normal
severity: normal
status: open
title: Pickling objects with recursive references and partials fail
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue33250] Move VERSION attribute output up in pydoc (via help() builtin)

2018-04-09 Thread handle

New submission from handle :

I'd like to suggest moving the output of a modules version, e.g. 

VERSION 
   __version__ 

up as it can "buried" by PACKAGE CONTENTS and DATA items.

https://github.com/python/cpython/blob/3.6/Lib/pydoc.py#L1181

The other attributes (date, author, credits) could be moved up, too, e.g. to 
https://github.com/python/cpython/blob/3.6/Lib/pydoc.py#L1117

Of course this depends on the use case (what are we looking for), but assuming 
these attributes are rather limited and constant in size, they would not be 
blocking access to the further items.

--
components: Library (Lib)
messages: 315128
nosy: handle
priority: normal
severity: normal
status: open
title: Move VERSION attribute output up in pydoc (via help() builtin)
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