[issue32876] HTMLParser raises exception on some inputs

2018-09-14 Thread Ezio Melotti


Change by Ezio Melotti :


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

___
Python tracker 

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



[issue26467] Add async magic method support to unittest.mock.Mock

2018-09-14 Thread Lisa Roach


Change by Lisa Roach :


--
keywords: +patch
pull_requests: +8725
stage: test needed -> patch review

___
Python tracker 

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



[issue33073] Add as_integer_ratio() to int() objects

2018-09-14 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +8726

___
Python tracker 

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



[issue21109] tarfile: Traversal attack vulnerability

2018-09-14 Thread shashank


shashank  added the comment:

Figured a fix for the bug I found, trick was to keep track of current working 
dir of symlink it was trying to evaluate.

Attached patch: safetarfile-3.diff
Patch is for code only.

I'd like to see this go thorough, and would appreciate feedback.

--
Added file: https://bugs.python.org/file47803/safetarfile-3.diff

___
Python tracker 

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



[issue34675] Avoid terminology related to slavery

2018-09-14 Thread Freed_Slave

New submission from Freed_Slave :

It is very good to see that "master" and "slave" terminology was removed from 
the project, however there are still references to "owned" references, as if 
these references were property. There are also things needing to be "freed" as 
if they were indentured servants.

I would like to open up discussion about better terminology - and when better 
terminology has been agreed upon I do not mind submitting a PR to get rid of 
this exclusive language.

"Freed" terminology:

* https://github.com/python/cpython/search?q=freed&unscoped_q=freed

There are also additional instances were "free" is used instead of "clear" but 
the context makes it harder to discover with a naive search.

"Owned" terminology:

* https://github.com/python/cpython/search?utf8=%E2%9C%93&q=owned&type=

"Master/Slave" terminology, now removed:

* https://bugs.python.org/issue34605

On the topic of inclusive/exclusive terminology, there are other problematic 
things that should be addressed - either here or in separate issues. However 
I'd like to draw attention to one particularly sexist email in 
`test_smtplib.py` "my_...@great.cooker.com" - hilarious! Not. It especially 
sticks out among the more generic and inclusive test emails. I particularly 
like the inclusion of "Páolo " but then in a test email he 
makes a sexual innuendo.

* https://github.com/python/cpython/search?utf8=%E2%9C%93&q=mom&type=

* Said innuendo: "oh là là, know what I mean, know what I mean?\n\n")"

--
assignee: docs@python
components: Documentation
messages: 325331
nosy: Freed_Slave, docs@python
priority: normal
severity: normal
status: open
title: Avoid terminology related to slavery
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



[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-09-14 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-09-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8728

___
Python tracker 

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



[issue33498] pathlib.Path wants an rmtree method

2018-09-14 Thread Lukas Röllin

Lukas Röllin  added the comment:

I definitely would like this too. I have a code base that's only grazing on 
path usage, and I could completely convert it to pathlib, but one shutil.rmtree 
still remains...

--
nosy: +Dreami

___
Python tracker 

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



[issue33073] Add as_integer_ratio() to int() objects

2018-09-14 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +8729

___
Python tracker 

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



[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-09-14 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue31305] 'pydoc -w import' report "no Python documentation found for 'import'"

2018-09-14 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

> Run "pydoc -w " to write out the HTML documentation for a module
to a file named ".html".

As mentioned in the help this works only for modules and since import is a 
keyword it throws an error. Maybe this could be added as an enhancement?

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue33073] Add as_integer_ratio() to int() objects

2018-09-14 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue33259] Encoding issue in the name of the local DST timezone

2018-09-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems like formatting timezone names on Windows has a lot of issues. I don't if 
it's related to the ones reported before but just like to add reference comment 
with more issues : https://bugs.python.org/msg302937

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue33173] GzipFile's .seekable() returns True even if underlying buffer is not seekable

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-09-14 Thread Anthony Flury


Anthony Flury  added the comment:

I still support backporting to 3.6 and 3.7 : 

Yes it is correct that this fix could change the behavior of existing test 
code, but only if someone has written a test case for a function where : 

 1. The function under test uses dunder_iter iteration
 2. The test case provides a read_data content to mock_open
 3. The test case expects a response from the function which 
implies that the file provided is empty/invalid in all cases - regardless 
of the data provided.

I simply cannot see that someone would implement a test case such as this - if 
your file has data, you would expect that your function under test would 
recognize that the data exists, if that data is valid; and most code will 
differentiate between invalid data and empty data.

So the only time I think this fix would change the behavior of existing code is 
if someone has written an illogical test case, which is currently passing and 
would now fail (since the test function will no2 see the data being provided 
and respond as such).

Specifically the only change in behavior to existing code is to highlight an 
invalid test case and potentially a bug in the code under test. It is for this 
reason I support backporting.

--

___
Python tracker 

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



[issue33073] Add as_integer_ratio() to int() objects

2018-09-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The merged PR contains several errors. See comments on GitHub.

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

___
Python tracker 

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



[issue33052] Sporadic segmentation fault in test_datetime

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue32496] lib2to3 fails to parse a ** of a conditional expression

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue32153] mock.create_autospec fails if an attribute is a partial function

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue32080] Re locale test fails after installing Python 3.6.3 on ubuntu 16.04

2018-09-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is it something specific to the environment? I tried the test on Ubuntu 16.04 
on both master and on v3.6.3 with no errors. Maybe if you can execute the 
following code based on which the test is executed then it will be helpful to 
debug this.


import locale

foo, enc = locale.getlocale(locale.LC_CTYPE)
# Search non-ASCII letter
for i in range(128, 256):
try:
c = bytes([i]).decode(enc)
sletter = c.lower()
if sletter == c: continue
bletter = sletter.encode(enc)
if len(bletter) != 1: continue
if bletter.decode(enc) != sletter: continue
bpat = re.escape(bytes([i]))
break
except (UnicodeError, TypeError):
pass
else:
bletter = None
bpat = b'A'
# Bytes patterns

print(bletter)
print(bpat)
print(foo)
print(enc)



Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue33073] Add as_integer_ratio() to int() objects

2018-09-14 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> The merged PR contains several errors. See comments on GitHub.

Some comments were seen after the merge of 8750 and were addressed in 9297.  If 
you want to change the checked in code, please open a separate PR and tracker 
item.  If you want different doc markup, please just fix it.  This issue has 
already sprawled out of proportion to its usefulness and has eaten many hours 
of our time.

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



[issue31290] segfault on missing library symbol

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34616] implement "Async exec"

2018-09-14 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> A utility to check whether an AST requires async mode should be fairly 
> straightforward.

Here is one case we forgot in IPython apparently :

In [1]: x = 1
   ...: def f():
   ...: nonlocal x
   ...: x = 1

This is not detected as a syntax error, but considered as asyn, we took an 
approach that prefer false positive (try to run invalid syntax as async) than 
false negative (reject valid async-code). Add this to the test suite for this 
feature.

--

___
Python tracker 

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



[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-09-14 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Can confirm this behavior on CPython master as well. It seems that when an 
attribute is deleted then a deleted flag is set for the attribute at 
https://github.com/python/cpython/blob/73820a60cc3c990abb351540ca27bf7689bce8ac/Lib/unittest/mock.py#L737
 . But when reset_mock is called it doesn't check for the deleted flag at 
https://github.com/python/cpython/blob/73820a60cc3c990abb351540ca27bf7689bce8ac/Lib/unittest/mock.py#L543

➜  cpython git:(master) ./python.exe ../backups/bpo31177.py
Traceback (most recent call last):
  File "../backups/bpo31177.py", line 5, in 
m.reset_mock()
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", 
line 546, in reset_mock
child.reset_mock(visited)
AttributeError: '_SentinelObject' object has no attribute 'reset_mock'

A simple patch would be to skip the deleted as below but some of the code in 
mock module raise an AttributeError. I don't know the correct behavior here. 
But applying the below patch and running tests with `./python.exe 
Lib/unittest/test/` doesn't cause any test failure.

diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index db1e642c00..700e2fb8b9 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -541,7 +541,7 @@ class NonCallableMock(Base):
 self._mock_side_effect = None
 
 for child in self._mock_children.values():
-if isinstance(child, _SpecState):
+if isinstance(child, _SpecState) or child is _deleted:
 continue
 child.reset_mock(visited)
 
I will try to make a PR if it's ok.

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34676] Guarantie that divmod() and PyNumber_Divmod() return a 2-tuple

2018-09-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

It is documented that divmod() returns a pair of numbers, but the 
implementation doesn't enforce this. Actually divmod() just returns the result 
of __divmod__() or __rdivmod__() without checking it. PyNumber_Divmod() is 
documented as the C equivalent of divmod(). But since it returns a 2-tuple in 
all implemented cases, the user code can expect that it always return a 
2-tuple. This can lead to hidden bugs similar to issue31577.

I think there are no reasons of returning anything except a 2-tuple from 
divmod(). Forcing this conditions can save third-party code from crashes. The 
following PR make divmod() and PyNumber_Divmod() always returning a 2-tuple.

--
components: Interpreter Core
messages: 325341
nosy: mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Guarantie that divmod() and PyNumber_Divmod() return a 2-tuple
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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-14 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Linking with newer SDKs is needed to get access to some newer features and 
APIs. That's less relevant for Python itself, but can be relevant for the 
embedding application.  You can still compile Python itself on an older 
machine, then link it into an application build against a newer SDK. This does 
make the build process harder though.

However, there seem to be some issues when you mix code linked for different 
deployment targets, for example 
.
  This is issue contains a C extension that works correctly when CPython is 
build with a new SDK and crashed hard with the interpreters on Python.org.

This is one reason why I will at some time in the future look into this, but I 
cannot say when that will happen because I have limited time to work on this.

--

___
Python tracker 

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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-14 Thread Christoph Reiter


Change by Christoph Reiter :


--
nosy:  -lazka

___
Python tracker 

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



[issue34676] Guarantie that divmod() and PyNumber_Divmod() return a 2-tuple

2018-09-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue33073] Add as_integer_ratio() to int() objects

2018-09-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8732

___
Python tracker 

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



[issue34675] Avoid terminology related to slavery

2018-09-14 Thread Mariatta Wijaya


Mariatta Wijaya  added the comment:

No thanks.

--
nosy: +Mariatta
resolution:  -> fixed
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



[issue34671] Remove references to Benevolent Dictator

2018-09-14 Thread Mariatta Wijaya


Mariatta Wijaya  added the comment:

No thanks.

--
nosy: +Mariatta
resolution:  -> fixed
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



[issue34677] Event scheduler page example

2018-09-14 Thread mediator42


New submission from mediator42 :

Hi,
I am pretty confident, that the example you put on the Event scheduler page 
(https://docs.python.org/3.7/library/sched.html) is somehow strange. 

If the priority argument behave as described, it should print the "keyword" 
line before the "positional" line, since these events are scheduled for the 
same time but "keyword" has a higher priority than "positional".

When I run this script on my PC it behaves correctly.

Best reagrds

--
assignee: docs@python
components: Documentation
messages: 325345
nosy: docs@python, mediator42
priority: normal
severity: normal
status: open
title: Event scheduler page example
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue34678] need to remove the term "white space"

2018-09-14 Thread dwayne gigleum


New submission from dwayne gigleum :

As we are purging offensive language

"white space" needs removing, as this can be offensive.

as seen in lots of places: 
https://github.com/python/cpython/search?p=1&q=white+space

--
messages: 325346
nosy: dwaygig
priority: normal
severity: normal
status: open
title: need to remove the term "white space"

___
Python tracker 

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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-14 Thread Zorg


Zorg  added the comment:

> Why do you believe that is safer?  Apple goes to great lengths to provide 
> compatibility for existing applications to keep running on newer systems. 

They also don't want developers to develop using older SDKs. Hypothetically 
speaking, more information may be stored in the binaries, and there could be 
something down the road to opt into that requires all binaries to be linked 
against a certain SDK. Or your code takes an older path based on the SDK 
version at runtime -- python may include some other higher level baggage too, 
like the tkinter stuff for instance.

There is some middle ground other than weak linking; stripping out features 
from the configure part of the project and opt in to using the deprecated APIs. 
Not as ideal as weak linking, but better than building on an older SDK IMO.

--

___
Python tracker 

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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-14 Thread Zorg


Zorg  added the comment:

Also more obviously: it's less convenient for others keeping themselves up to 
date to set up an older development environment.

--

___
Python tracker 

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



[issue33052] Sporadic segmentation fault in test_datetime

2018-09-14 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-09-14 Thread Ned Deily


Ned Deily  added the comment:

The potential change in behavior affecting existing code was one issue.  But 
the other was the fact that people writing tests to make use of the new 
behavior can't depend on that behavior being there for 3.7 or 3.6 without 
checking the patch level, for example, 3.6.7 vs 3.6.6.  That's one of the main 
reasons we generally do not backport behavior changes unless they are a clear 
bug; as I noted. this particular issue seems somewhere in between a bug and a 
feature.  Given how far along we are in the 3.6.x cycle, I think we definitely 
should not backport to 3.6.  Since 3.7 is near the beginning of its support 
cycle, I would not object if we did backport this for 3.7.1.  I'll leave it up 
to Berker.

--

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2018-09-14 Thread Nic Watson


New submission from Nic Watson :

Summary:  essentially asyncio.add_signal_handler doesn't work when called off 
the main thread.  One might consider this a documentation failure.

(Note: there's also a bigger issue with cleanup, which I'll submit separately)

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/nic/.pyenv/versions/3.6.4/lib/python3.6/asyncio/unix_events.py", 
line 91, in add_signal_handler
signal.set_wakeup_fd(self._csock.fileno())
ValueError: set_wakeup_fd only works in main thread

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nic/.pyenv/versions/3.6.4/lib/python3.6/threading.py", line 916, 
in _bootstrap_inner
self.run()
  File "/home/nic/.pyenv/versions/3.6.4/lib/python3.6/threading.py", line 864, 
in run
self._target(*self._args, **self._kwargs)
  File "/home/nic/tmp/signal_event_loop_bug.py", line 14, in do_loop
loop.add_signal_handler(signal.SIGINT, mysighandler)
  File "/home/nic/.pyenv/versions/3.6.4/lib/python3.6/asyncio/unix_events.py", 
line 93, in add_signal_handler
raise RuntimeError(str(exc))
RuntimeError: set_wakeup_fd only works in main thread

Code:

import asyncio
import signal
import threading

def mysighandler():
pass

def do_loop():
loop = asyncio.new_event_loop()
# This will fail with RuntimeError: set_wakeup_fd only works in main thread
loop.add_signal_handler(signal.SIGINT, mysighandler)
loop.close()

t = threading.Thread(target=do_loop)
t.start()
t.join()

--
components: asyncio
messages: 325350
nosy: asvetlov, jnwatson, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.add_signal_handler call fails if not on main thread
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue34605] Avoid master/slave terminology

2018-09-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

News about this issue published on different resources are exaggerated. 
Actually the controversial changes were rejected. All merged changes look 
correct to me, they fix outdated terminology ("worker" instead of "buildslave" 
is now the official term in the Buildbot documentation) and make the 
documentation using more common terminology (for example "parent process" 
instead of "master process" in context of multiprocessing).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34653] PyParser_SimpleParseStringFilename should be deleted

2018-09-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm not going to backport this to 3.7, just in case.

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

___
Python tracker 

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



[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-09-14 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 9b9d97dd139a799d28ff8bc90d118b1cac190b03 by Eric V. Smith in 
branch 'master':
bpo-34363: dataclasses.asdict() and .astuple() now handle fields which are 
namedtuples. (GH-9151)
https://github.com/python/cpython/commit/9b9d97dd139a799d28ff8bc90d118b1cac190b03


--

___
Python tracker 

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



[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-09-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8733

___
Python tracker 

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



[issue34680] asyncio event_loop close fails off main thread if signal handler registered

2018-09-14 Thread Nic Watson


New submission from Nic Watson :

If a signal handler callback is registered on an event loop, and the event loop 
has close() called on it, the close will fail.

Exception:
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/nic/.pyenv/versions/3.7.0/lib/python3.7/threading.py", line 917, 
in _bootstrap_inner
self.run()
  File "/home/nic/.pyenv/versions/3.7.0/lib/python3.7/threading.py", line 865, 
in run
self._target(*self._args, **self._kwargs)
  File "/home/nic/tmp/signal_event_loop_bug.py", line 9, in do_loop
loop.close()
  File "/home/nic/.pyenv/versions/3.7.0/lib/python3.7/asyncio/unix_events.py", 
line 58, in close
self.remove_signal_handler(sig)
  File "/home/nic/.pyenv/versions/3.7.0/lib/python3.7/asyncio/unix_events.py", 
line 147, in remove_signal_handler
signal.signal(sig, handler)
  File "/home/nic/.pyenv/versions/3.7.0/lib/python3.7/signal.py", line 47, in 
signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread

Code:
import asyncio
import signal
import threading

def mysighandler():
pass

def do_loop(loop):
loop.close()

loop = asyncio.new_event_loop()
loop.add_signal_handler(signal.SIGINT, mysighandler)
t = threading.Thread(target=do_loop, args=(loop,))
t.start()
t.join()

--
components: asyncio
messages: 325354
nosy: asvetlov, jnwatson, yselivanov
priority: normal
severity: normal
status: open
title: asyncio event_loop close fails off main thread if signal handler 
registered
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue34680] asyncio event_loop close fails off main thread if signal handler registered

2018-09-14 Thread epiphyte


Change by epiphyte :


--
nosy: +epiphyte

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2018-09-14 Thread epiphyte


Change by epiphyte :


--
nosy: +epiphyte

___
Python tracker 

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



[issue34582] VSTS builds should use jobs, pools, and test results

2018-09-14 Thread Steve Dower


Steve Dower  added the comment:

Co-opting this bug for my own PR, that will include these changes as well as 
generating JUnit-format test results and publishing them in Azure Pipelines 
builds.

--
assignee:  -> steve.dower
components: +Build, Tests
title: VSTS builds should use new YAML syntax and pools -> VSTS builds should 
use jobs, pools, and test results
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34582] VSTS builds should use jobs, pools, and test results

2018-09-14 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +8734

___
Python tracker 

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



[issue34678] need to remove the term "white space"

2018-09-14 Thread Carol Willing


Change by Carol Willing :


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



[issue33649] asyncio docs overhaul

2018-09-14 Thread Carol Willing


Change by Carol Willing :


--
pull_requests: +8735

___
Python tracker 

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



[issue34678] need to remove the term "white space"

2018-09-14 Thread dwayne gigleum


dwayne gigleum  added the comment:

are you being a hypocrit trying to supress me?

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

___
Python tracker 

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



[issue34672] '%Z' strftime specifier never works with musl

2018-09-14 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 5633c4f342d957df2ef0d67b9bfb472a0d28a76b by Benjamin Peterson in 
branch 'master':
bpo-34672: Try to pass the C library's own timezone strings back to it. 
(GH-9288)
https://github.com/python/cpython/commit/5633c4f342d957df2ef0d67b9bfb472a0d28a76b


--

___
Python tracker 

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



[issue34678] need to remove the term "white space"

2018-09-14 Thread Éric Araujo

Éric Araujo  added the comment:

Trolling is not welcome.

--
nosy: +eric.araujo
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue34672] '%Z' strftime specifier never works with musl

2018-09-14 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue34681] Incorrect class name Pattern in sre_parse.py

2018-09-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

In 8a3ebf8ca87a7d2989148d7c218974ab4235ca5d, with synchronizing regex engine 
with SRE 0.9.6, the class State in sre_parse.py was renamed to Pattern and the 
following comment was added: "master pattern object.  keeps track of global 
attributes".

This name is incorrect and misleading. This class doesn't represents a pattern 
in any sense. It just keeps global flags and groups information for parser. 
There is a class SupParser in sre_parse.py that represents a pattern or its 
part in intermediate representation, and there is a class Pattern defined in 
sre.c and exposed publicly, that represents a compiled pattern.

The proposed PR renames Pattern back to State and renames attribute, parameter 
and variable names for referring to objects of this class from pattern to 
state. All this is an internal API, but since there may be a third-party that 
uses it, it is for developer version only.

--
components: Library (Lib), Regular Expressions
messages: 325359
nosy: effbot, ezio.melotti, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Incorrect class name Pattern in sre_parse.py
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



[issue34681] Incorrect class name Pattern in sre_parse.py

2018-09-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34681] Incorrect class name Pattern in sre_parse.py

2018-09-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +ethan.furman

___
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-09-14 Thread Petr Viktorin


Petr Viktorin  added the comment:

1) If I understand correctly, this problem could be solved by per-class C 
storage? Something like PyModuleDef.m_size / PyModule_GetState, but for classes?

2) Making PyType_GetSlot work for static types would not be trivial. 
All types do have the same *basic* structure (the tp_* fields), but the 
nb_*/sq_*/etc. fields don't need to be in the same order, and might not exist 
at all.
Even making it work for the tp_* fields only would bake in some assumptions I 
do want to get rid of.
I'd like to understand your use case better. Do you have a specific example 
here?

--

___
Python tracker 

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



[issue34676] Guarantie that divmod() and PyNumber_Divmod() return a 2-tuple

2018-09-14 Thread Paul Ganssle


Paul Ganssle  added the comment:

I would be somewhat worried that this might break something like numpy (though 
not numpy specifically) which might be counting on the ability to write a 
wrapper that overloads this behavior.

Another concern is that people could be playing it fast-and-loose with actual 
types, and are returning something that fits the bill for a 
collections.abc.Sequence with length 2 (e.g. return [a, b]) but isn't an actual 
Tuple.

I would at least think that this should go through a deprecation cycle.

--
nosy: +p-ganssle

___
Python tracker 

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



[issue34682] Typo reports on docs@

2018-09-14 Thread Zachary Ware

New submission from Zachary Ware :

>From ZooDSS (Никита Люшненко) on docs@:

https://mail.python.org/pipermail/docs/2018-September/037223.html :
"""
https://docs.python.org/3/reference/datamodel.html#metaclass-example - 
"uses an collections.OrderedDict to remember" when it is better to use 
"uses a collections.OrderedDict to remember"

https://docs.python.org/3/reference/executionmodel.html#exceptions
"Exceptions are a means" - Is it correct to use "a" here? "means" means a lot 
of them. "a" means one.

"In either case, it prints a stack backtrace" - most of the time in Python 
documentation term "traceback" is used instead of "backtrace". It may mislead 
newcomers, so they will think, that this is potentially a new term.

https://docs.python.org/3/reference/expressions.html#yield-expressions
"Due to their side effects on the containing scope, yield expressions are not 
permitted as part of the implicitly defined scopes used to implement 
comprehensions and generator expressions (in Python 3.7, such expressions emit 
DeprecationWarning when compiled, in Python 3.8+ they will emit SyntaxError).." 
- two periods in the end of the sentence.

https://docs.python.org/3/reference/expressions.html#yield-expressions
"...or automatically when the sub-iterator is a generator (by returning a value 
from the sub-generator)." - inconsistent use of "sub-iterator" term. Previously 
subiterator was referenced several times as "subiterator" not "sub-iterator".

If i understood something wrong, then i am sorry.
"""

https://mail.python.org/pipermail/docs/2018-September/037224.html :
"""
https://docs.python.org/3/reference/expressions.html#yield-expressions

Term "sub-generator" is used in PEP 280 without dash ("-") symbol - 
"subgenerator". At the same time it is used as "sub-generator" 2 times on this 
page:

"generator (by returning a value from the sub-generator)." - here.

"The proposal to introduce the yield_from syntax, making delegation to 
sub-generators easy." - and here.
"""

https://mail.python.org/pipermail/docs/2018-September/037237.html :
"""
https://docs.python.org/3/reference/expressions.html#asynchronous-generator-functions
"function as a asynchronous generator function." - it's better to say "function 
as an asynchronous generator function."

https://docs.python.org/3/reference/expressions.html#agen.__anext__
"When an asynchronous generator function is resumed with a __anext__() method" 
- may be better "...function is resumed with an __anext__() method".

"the awaitable instead raises an StopAsyncIteration exception" - at the same 
time here may be better to use "the awaitable instead raises a 
StopAsyncIteration exception".

https://docs.python.org/3/reference/expressions.html#agen.athrow
"an StopAsyncIteration exception is raised" - here is the same situation as 
previously. "a" instead of "an" may be better.

Here goes very special case, and if i am wrong you can laugh on me as much as 
you wish! =)

https://docs.python.org/3/reference/expressions.html#parenthesized-forms
"Since tuples are immutable, the rules for literals apply" - Tuples are 
immutable, but not literals. So may be "the same rules as for literals apply" 
is better? Or does it apply exactly those rules, that apply for literals? "()" 
- this is a literal, that yelds an empty tuple. But this doesn't connect, or i 
am wrong? If i am - then i am very sorry.

Again, if i mistook something - i am sorry. Thanks for the good work. This is 
the best documentation i've ever seen.
"""

--
assignee: docs@python
components: Documentation
messages: 325362
nosy: docs@python, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Typo reports on docs@
versions: Python 2.7, 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



[issue33070] Add platform triplet for RISC-V

2018-09-14 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> add new triplets for mips r6 and riscv variants

___
Python tracker 

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



[issue34682] Typo reports on docs@

2018-09-14 Thread Geoffrey Spear


Geoffrey Spear  added the comment:

"Means" is perfectly acceptable to use as a singular form: 
http://grammarist.com/usage/means/ (the rest of these all look like legitimate 
typos)

--
nosy: +geoffreyspear

___
Python tracker 

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



[issue34676] Guarantie that divmod() and PyNumber_Divmod() return a 2-tuple

2018-09-14 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

-0 Perhaps this should be left as-is.  There is no known problem that we would 
be solving and it would add an extra step to a fine-grained function.  In 
general, I think we have these guards in places where it is known that 
downstream callers rely on a particular type signature for the return value.

--
nosy: +rhettinger

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-09-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8737

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-14 Thread Carol Willing


Carol Willing  added the comment:


New changeset c9d66f0ed4f07b9d184d22abbfdd4c3c8e2702df by Carol Willing in 
branch 'master':
bpo-33649 Polish asyncio docs on queues, protocols, and subproccesses (#9306)
https://github.com/python/cpython/commit/c9d66f0ed4f07b9d184d22abbfdd4c3c8e2702df


--

___
Python tracker 

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



[issue34672] '%Z' strftime specifier never works with musl

2018-09-14 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +8738

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-14 Thread Guido van Rossum


New submission from Guido van Rossum :

Input file with a subtle error: a number where an assignment target is required:

for 1 in []: pass

Run it, it gives a SyntaxError.  Note how the caret pointing to the incorrect 
token is position one to the left of where you'd expect it:

  File "s.py", line 1
for 1 in []: pass
   ^
SyntaxError: can't assign to literal

For every syntax error I've seen that's produced by ast.c this seems to be the 
case -- the caret is always positioned 1 too far left.

I tried to understand how this is happening but my AST-fu is lacking. It seems 
this has been happening since ast.c started added column numbers -- in Python 
2.7 there's no caret at all, but in 3.4 and later there's a caret and it has 
the same problem. (Also in 3.3; I don't have 3.2 or older 3.x lying around to 
test.)

--
messages: 325366
nosy: gvanrossum
priority: low
severity: normal
status: open
title: Caret positioned wrong for SyntaxError reported by ast.c
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



[issue33259] Encoding issue in the name of the local DST timezone

2018-09-14 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-14 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue31635] test_strptime failure on OpenBSD

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue32313] Wrong inspect.getsource for datetime

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34684] Generate _geoslib.c with Cython 0.28.2 for Python 3.7 transition

2018-09-14 Thread shirish


New submission from shirish :

umm... I do not know about python other than python $something.py to run a 
python script. 

At Debian people are having an issue with not having _geoslib.c generated with 
a more recent Cython 0.28.2 for the transition. 

There is a patch and the bug has been put at 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903579

Could somebody have a look at it and recommend either at the bug-report or here 
what could be done to fix the issue.

--
components: Build
messages: 325367
nosy: shirish
priority: normal
severity: normal
status: open
title: Generate _geoslib.c with Cython 0.28.2 for Python 3.7 transition
type: compile error
versions: Python 3.7

___
Python tracker 

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



[issue34672] '%Z' strftime specifier never works with musl

2018-09-14 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset b93062b7fbc965cd0d522f597ed51eb4e493dfc2 by Benjamin Peterson in 
branch 'master':
bpo-34672: Don't pass NULL to gmtime_r. (GH-9312)
https://github.com/python/cpython/commit/b93062b7fbc965cd0d522f597ed51eb4e493dfc2


--

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-14 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +8739

___
Python tracker 

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



[issue34684] Generate _geoslib.c with Cython 0.28.2 for Python 3.7 transition

2018-09-14 Thread Zachary Ware


Zachary Ware  added the comment:

_geoslib.c is not part of the core distribution of Python, and in fact I don't 
know which project it *is* part of.  I'm afraid you'll need to find its home 
project and report this there.

--
nosy: +zach.ware
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



[issue34685] scheduler tests for posix_spawn fail on AMD64 FreeBSD 10.x Shared 3.x

2018-09-14 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

https://buildbot.python.org/all/#/builders/87/builds/1428/steps/4/logs/stdio


==
ERROR: test_setscheduler_with_policy (test.test_posix.TestPosixSpawn)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_posix.py", 
line 1693, in test_setscheduler_with_policy
scheduler=(policy, os.sched_param(priority))
PermissionError: [Errno 1] Operation not permitted: 
'/usr/home/buildbot/python/3.x.koobs-freebsd10/build/python'
==
FAIL: test_setscheduler_only_param (test.test_posix.TestPosixSpawn)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_posix.py", 
line 1677, in test_setscheduler_only_param
self.assertEqual(os.waitpid(pid, 0), (pid, 0))
AssertionError: Tuples differ: (96981, 256) != (96981, 0)
First differing element 1:
256
0
- (96981, 256)
? ^^^
+ (96981, 0)
? ^
--

--
components: Tests
messages: 325370
nosy: pablogsal
priority: normal
severity: normal
status: open
title: scheduler tests for posix_spawn fail on AMD64 FreeBSD 10.x Shared 3.x
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



[issue34686] Add `-r`, as opposed to `-R` to Python core interpreter

2018-09-14 Thread Erwan Le Pape


New submission from Erwan Le Pape :

I'm attempting to leverage PEP 552 to make the core interpreter build process 
more deterministic. However, the standard Python Makefile uses `python -E` when 
calling the compileall (and all other setup scripts), which forces 
randomization since it can only be turned off through environment variables 
(which in turn leads to nondeterministic behaviour as noted in PEP 552 [1],[2]).

Also, is adding a flag that disables randomization something that would be 
acceptable? Or are options to the core interpreter to be kept to a minimum and 
this does not represent a large enough use-case?

This would basically hold in Modules/main.c in something as short as:
+ case 'r':
+ config->use_hash_seed = 1;
+ config->hash_seed = 0;
+ break;

--
components: Interpreter Core
messages: 325371
nosy: lepaperwan
priority: normal
severity: normal
status: open
title: Add `-r`, as opposed to `-R` to Python core interpreter
type: enhancement
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



[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-09-14 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 78aa3d8f5204bc856d7b2eb67288cf90c6a30660 by Eric V. Smith (Miss 
Islington (bot)) in branch '3.7':
bpo-34363: dataclasses.asdict() and .astuple() now handle fields which are 
namedtuples. (GH-9151) (GH-9304)
https://github.com/python/cpython/commit/78aa3d8f5204bc856d7b2eb67288cf90c6a30660


--

___
Python tracker 

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



[issue28955] Not matched behavior of numeric comparison with the documentation

2018-09-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8740

___
Python tracker 

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



[issue28955] Not matched behavior of numeric comparison with the documentation

2018-09-14 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset ad8a0004206ba7aec5a8a60fce413da718080db2 by Benjamin Peterson 
(Tony Flury) in branch 'master':
closes bpo-28955: Clarified comparisons between NaN and number in reference 
documentation (GH-5982)
https://github.com/python/cpython/commit/ad8a0004206ba7aec5a8a60fce413da718080db2


--
nosy: +benjamin.peterson
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



[issue34682] Typo reports on docs@

2018-09-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

Agreed with @geoffreyspear: "means" is okay, the rest of the changes look good.

--
nosy: +eric.smith

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm doing some fairly major surgery on line and column numbers for fixing 
f-string errors. I'll see if I can include this case, too.

--
nosy: +eric.smith

___
Python tracker 

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



[issue34685] scheduler tests for posix_spawn fail on AMD64 FreeBSD 10.x Shared 3.x

2018-09-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Some extra stdout when I try to reproduce this on FreeBSD:

test_setscheduler_only_param (test.test_posix.TestPosixSpawn) ... Traceback 
(most recent call last):
  File "", line 5, in 
AttributeError: module 'os' has no attribute 'exit'
FAIL
test_setscheduler_with_policy (test.test_posix.TestPosixSpawn) ... Traceback 
(most recent call last):
  File "", line 5, in 
AttributeError: module 'os' has no attribute 'exit'
FAIL

--

___
Python tracker 

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



[issue28955] Not matched behavior of numeric comparison with the documentation

2018-09-14 Thread miss-islington


miss-islington  added the comment:


New changeset ca2fa2841f8e3ce5213a0e8c0abc1d0fdc7d386b by Miss Islington (bot) 
in branch '3.7':
closes bpo-28955: Clarified comparisons between NaN and number in reference 
documentation (GH-5982)
https://github.com/python/cpython/commit/ca2fa2841f8e3ce5213a0e8c0abc1d0fdc7d386b


--
nosy: +miss-islington

___
Python tracker 

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



[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

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



[issue32933] mock_open does not support iteration around text files.

2018-09-14 Thread Berker Peksag


Berker Peksag  added the comment:

Thanks, Ned!

Anthony, I'm one of the maintainers of https://github.com/testing-cabal/mock 
and I'd be happy to merge a PR that backports the fix to the PyPI version of 
mock.

--
versions: +Python 3.7

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-09-14 Thread Anthony Flury


Anthony Flury  added the comment:

Thank you.

--

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-14 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

I think ast.c is in the right here and there are two complementary bugs in 
caret printing and the parser.

print_error_text does this:

while (--offset > 0)
PyFile_WriteString(" ", f);

which is off-by-one if offset is zero-indexed (which it should be IMO).

The parser has an off-by-one error in the other direction. When it reports an 
error, it reports the offset of the tokenizer's "cur" buffer. This is generally 
advanced past the location that actually resulted in a parser error. I believe 
the parser should be fixed to report the error offset as the offset of the 
start of the token that caused the error.

--
nosy: +benjamin.peterson -eric.smith, xtreak

___
Python tracker 

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



[issue34686] Add `-r`, as opposed to `-R` to Python core interpreter

2018-09-14 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

It would be preferable to fix build outputs to be deterministic even under 
randomization in the interpreter.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-14 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +eric.smith

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think Benjamin's diagnosis is correct. In which case, my f-string error 
reporting changes (see #34364) won't intersect with a fix to this issue.

--

___
Python tracker 

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



[issue31392] Upgrade installers to OpenSSL 1.1.0g and 1.0.2n

2018-09-14 Thread Ned Deily


Ned Deily  added the comment:

Sorry, this should have been closed a while back.  We're now on to 1.0.2p for 
3.6.7 and 1.1.0i for 3.7.1.

--
resolution:  -> out of date
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



[issue3468] Satisfy her lovemaking desire

2018-09-14 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +8741

___
Python tracker 

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



[issue34685] scheduler tests for posix_spawn fail on AMD64 FreeBSD 10.x Shared 3.x

2018-09-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

What is failing is this line in the spawned process:

os.sched_getparam(0).sched_priority != {priority}

For some reason posix_spawn cannot change the priority in BSD. I have tried to 
hardcode the change in the implementation but the priority does not change in 
the child.

I am out of ideas, except skipping the tests on these systems.

--

___
Python tracker 

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



[issue34685] scheduler tests for posix_spawn fail on AMD64 FreeBSD 10.x Shared 3.x

2018-09-14 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue32313] Wrong inspect.getsource for datetime

2018-09-14 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue31635] test_strptime failure on OpenBSD

2018-09-14 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue24937] Multiple problems in getters & setters in capsulethunk.h

2018-09-14 Thread Petr Viktorin


Petr Viktorin  added the comment:

Well, hasn't this languished for a while.

I've talked with Benjamin, and he's OK with just removing the "Porting 
Extension Modules to Python 3" HOWTO, and replacing it by links to external 
guides that do a much better job at documenting this.

Also, Python 2.6 and 3.0 is EOL; it should be fine to scrub capsulethunk.

--

___
Python tracker 

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



[issue24937] Multiple problems in getters & setters in capsulethunk.h

2018-09-14 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +8743

___
Python tracker 

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



  1   2   >