[issue36872] passing negative values through modules

2019-05-09 Thread David Collins


David Collins  added the comment:

This is an issue with python

On Fri, 10 May 2019 at 3:52 pm, SilentGhost  wrote:

>
> Change by SilentGhost :
>
>
> --
> components:  -IDLE
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue36872] passing negative values through modules

2019-05-09 Thread SilentGhost


SilentGhost  added the comment:

This bug tracker is for development of CPython, please ask your question on 
python-help mailing list, IRC or other similar forums.

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: compile error -> behavior

___
Python tracker 

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



[issue36872] passing negative values through modules

2019-05-09 Thread David Collins


David Collins  added the comment:

Not the coding

On Fri, 10 May 2019 at 3:53 pm, David Collins  wrote:

> This is an issue with python
>
> On Fri, 10 May 2019 at 3:52 pm, SilentGhost 
> wrote:
>
>>
>> Change by SilentGhost :
>>
>>
>> --
>> components:  -IDLE
>>
>> ___
>> Python tracker 
>> 
>> ___
>>
>

--

___
Python tracker 

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



[issue36872] passing negative values through modules

2019-05-09 Thread SilentGhost


Change by SilentGhost :


--
components:  -IDLE

___
Python tracker 

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



[issue26317] Build Problem with GCC + Macintosh OS X 10.11 El Capitain

2019-05-09 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

Module/_scproxy.c compiles cleanly with clang 10.0.0 and fails with GNU gcc 
8.3.0. Below is the relevant compiler error:

building '_scproxy' extension
gcc-8 -Wno-unused-result -Wsign-compare -g -Og -Wall -pipe -std=c99 -Wextra 
-Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -I../cpython/Include/internal 
-I../cpython/Include -IObjects -IPython -I. -I/usr/local/opt/zlib/include 
-I/usr/local/opt/sqlite/include -I/usr/local/Cellar/ossp-uuid/1.6.2_2/include 
-I/usr/local/include -I/Users/jeff/sandbox/src/python3.7/cpython/Include 
-I/Users/jeff/sandbox/src/python3.7/build -c 
/Users/jeff/sandbox/src/python3.7/cpython/Modules/_scproxy.c -o 
build/temp.macosx-10.14-x86_64-3.8-pydebug/Users/jeff/sandbox/src/python3.7/cpython/Modules/_scproxy.o
In file included from 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h:32,
 from 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:42,
 from 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferences.h:35,
 from 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers/SystemConfiguration.h:126,
 from 
/Users/jeff/sandbox/src/python3.7/cpython/Modules/_scproxy.c:6:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h:193:7:error:
 variably modified 'bytes' at file scope
  char bytes[kAuthorizationExternalFormLength];
   ^
building 'zlib' extension

--

___
Python tracker 

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



[issue36873] http.server: Document explicitly that symbolic links are followed

2019-05-09 Thread STINNER Victor


New submission from STINNER Victor :

http.server documentation starts with a red warning:

"Warning: http.server is not recommended for production. It only implements 
basic security checks."

https://docs.python.org/dev/library/http.server.html

It would help to be even more explicit on what it means. For example, document 
that symbolic links are followed and SimpleHTTPRequestHandler directory can be 
"escaped" following symbolic links.

--
assignee: docs@python
components: Documentation
messages: 342054
nosy: docs@python, vstinner
priority: normal
severity: normal
status: open
title: http.server: Document explicitly that symbolic links are followed
type: security
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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Since we aren't backporting ARM32 changes, I don't think it's important to 
> fix this test in 3.7.  I am trying to get the buildbot tests for Windows 
> ARM32 to zero errors.

Ok, thanks. I close the 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



[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

2019-05-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13144

___
Python tracker 

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



[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

2019-05-09 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:


New changeset 79efbb719383386051c72f2ee932eeca8e033e6b by Giampaolo Rodola 
(Olexa Bilaniuk) in branch 'master':
bpo-24538: Fix bug in shutil involving the copying of xattrs to read-only 
files. (PR-13212)
https://github.com/python/cpython/commit/79efbb719383386051c72f2ee932eeca8e033e6b


--

___
Python tracker 

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



[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

2019-05-09 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


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



[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

2019-05-09 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Patch LGTM. I'd like to point out one thing for posterity. Current shutil code 
catches EPERM but not EACCES. While reviewing the patch I wondered whether 
simply catching (and ignoring) both error codes instead, but it turns out they 
are supposed to have 2 different meanings:
https://stackoverflow.com/a/35879961/376587
Especially after _copyxattr is moved before chmod() EACCES (permission denied) 
should propagate instead of being silenced, and EPERM should be left in place 
because in this case EPERM acts more like an ENOTSUP (operation not supported) 
than EACCES (permission denied) and as such should rightly be ignored.

--

___
Python tracker 

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



[issue36872] passing negative values through modules

2019-05-09 Thread David Collins


David Collins  added the comment:

I have tested this in the Mac and PC versions of IDLE as well as in Spyder 
using Ipython.

--

___
Python tracker 

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



[issue36872] passing negative values through modules

2019-05-09 Thread David Collins


New submission from David Collins :

program_data.py file contains a list 

import list_function
 
str_list4 = ['i', 't']
str_list4 = list_function.insert_value(str_list4, 's', -1)
print(str_list4)


list_function.py file 

def insert_value(my_list, value, insert_position):
counter = 0
print('Question 5')
print(my_list, value, insert_position)
for index in my_list:
counter += 1

when passing the negative number in insert_position between the two modules 
this causes

 str_list4 = list_function.insert_value(str_list4, 's', -1)

  File "D:\part A\list_function.py", line 85, in insert_value
for index in my_list:

TypeError: 'NoneType' object is not iterable

my_list now becomes lost, if the negative value is changed to positive this 
clears up . 

if you assign the -1 to a variable or a contstant it does not matter 
it still causes the same issue. 

however if you are running this code in the same module it works fine. this 
only seems to appear when attempting to pass between 2 modules a negative 
number.

--
assignee: terry.reedy
components: IDLE
messages: 342049
nosy: coldy028, terry.reedy
priority: normal
severity: normal
status: open
title: passing negative values through modules
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



[issue36823] shutil.copytree copies directories and files but fails with that same directory with '[Errno 1] Operation not permitted')

2019-05-09 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

You should try to copy those offending files individually via shutil.copy2() 
instead copytree() in order to get the full exception.

--

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread Paul Monson


Paul Monson  added the comment:

Thanks Victor!  Since we aren't backporting ARM32 changes, I don't think it's 
important to fix this test in 3.7.  I am trying to get the buildbot tests for 
Windows ARM32 to zero errors.

Windows IoT Core runs on Raspberry Pi and similar devices: 
https://developer.microsoft.com/en-us/windows/iot

Windows NanoServer is a very small version of Windows Server for running in 
Docker containers hosted on Windows Server.

--

___
Python tracker 

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



[issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

Berker Peksag:
> Please revert 360e1e4c519cfc139de707bcdd1e6c871eec79ee. It's not a good 
> example to put into the documentation.

I looked at other examples: they are nice but far from a "real application". I 
like the last example which combines multiple wsgiref features and is written 
like a real application: parse command line arguments, handle CTRL+c, etc.


> It uses different naming convention. It would only confuse users relatively 
> new to the wsgiref module and WSGI protocol.

Would you mind to elaborate? I don't understand what you mean by "naming 
convention" here, sorry.


> FileWrapper was supposed to support __getitem__ and __iter__ protocols for 
> compatibility with older Python versions, but its __getiem__ implementation 
> is buggy and is already deprecated. It has no use case in modern Python code.

Do you mean that app() must not return FileWrapper? How do you return file 
content in that case?

Maybe FileWrapper API should be clarified? It's surprising to read Python 3.8 
mentioning compatibility with Python 2.1 :-)


> It has zero exception handling and will return a cryptic traceback if 
> mimetype cannot detect type of the file.

Which kind of exceptions do you expect? The example checks if the file exists 
for example.

--

___
Python tracker 

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



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2019-05-09 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

I've added another test executable (issue36792-2.zip) which should bring some 
insight into where things are going wrong.  Please run and post the results.

--
Added file: https://bugs.python.org/file48324/issue36792-2.zip

___
Python tracker 

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



[issue14353] Proper gettext support in locale module

2019-05-09 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

seems okay

--

___
Python tracker 

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



[issue36818] Add PyInterpreterState.runtime.

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

I don't see the point of PyInterpreterState.runtime:

* I understood that we should have and only one _PyRuntimeState instance: 
_PyRuntime. Why not accessing it directly?
* I understood that most _PyRuntimeState fields should be moved to 
PyInterpreterState. Once this refactoring will be done, we will almost never 
have to access _PyRuntime.

--

___
Python tracker 

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



[issue33725] Python crashes on macOS after fork with no exec

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

I have no preference for the default on Linux, but please fix the default at 
least on macOS before Python 3.8 beta 1 ;-)

--

___
Python tracker 

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



[issue36479] Exit threads when interpreter is finalizing rather than runtime.

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

IMHO PR 12679 change should wait until Py_EndInterpreter() is reworked to 
better cleanup its state and its threads.

--

___
Python tracker 

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



[issue34408] possible null pointer dereference in pystate.c

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Any reason not to close this issue?

Pablo: Do you want to backport your fix to Python 3.7? Python 3.7 has the same 
bug, no? (I didn't check.)

--

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.8

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Before Vista, the code page 65001 behaved differently than official UTF-8 
> codec. Vista changed that. Maybe it's time to remove Lib/encodings/cp65001.py 
> and make it an alias to utf_8 codec: see 
> https://bugs.python.org/issue36778#msg341531

FYI it's exactly what I did:

New changeset d267ac20c309e37d85a986b4417aa8ab4d05dabc by Victor Stinner in 
branch 'master':
bpo-36778: cp65001 encoding becomes an alias to utf_8 (GH-13230)
https://github.com/python/cpython/commit/d267ac20c309e37d85a986b4417aa8ab4d05dabc

--

___
Python tracker 

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



[issue36814] posix_spawn explicit file_actions=None throws error

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

Matthew Tanous: Oops, I completely missed this case! Thanks for the bug report.

Thanks Anthony Shaw for the fix.

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



[issue36814] posix_spawn explicit file_actions=None throws error

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 948ed8c96b6912541a608591efe3e00fb520429a by Victor Stinner 
(Anthony Shaw) in branch 'master':
bpo-36814: ensure os.posix_spawn() handles None (GH-13144)
https://github.com/python/cpython/commit/948ed8c96b6912541a608591efe3e00fb520429a


--
nosy: +vstinner

___
Python tracker 

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



[issue26317] Build Problem with GCC + Macintosh OS X 10.11 El Capitain

2019-05-09 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

This is still an issue with the 3.7 and the master branches. The Objective-C 
portion of the build still fails with gcc 8.3.0 on OS X Mojave (14.x). 
Specifying OBJC and OBJC++ on the configure command line does nothing because 
there is nothing in the script using the options.

--
nosy: +websurfer5
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



[issue36841] Supporting customization of float encoding in JSON

2019-05-09 Thread Wei Lee


Change by Wei Lee :


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

___
Python tracker 

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



[issue15987] Provide a way to compare AST nodes for equality recursively

2019-05-09 Thread STINNER Victor


Change by STINNER Victor :


--
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue27497] csv module: Add return value to DictWriter.writeheader

2019-05-09 Thread STINNER Victor

STINNER Victor  added the comment:

I merged PR 12306. Thanks Ashish Nitin Patil for the initial patch, thanks Rémi 
Lapeyre to converting it to a PR, thanks Logan for the initial bug report ;-)

Sadly, this change is a new feature and so cannot be backported to 2.7 or 3.7. 
The workaround is override the method:

def writeheader(self):
header = dict(zip(self.fieldnames, self.fieldnames))
return self.writerow(header)

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



[issue27497] csv module: Add return value to DictWriter.writeheader

2019-05-09 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset fce5ff1e18b522cf52379934a6560583d840e7f9 by Victor Stinner (Rémi 
Lapeyre) in branch 'master':
bpo-27497: Add return value to csv.DictWriter.writeheader (GH-12306)
https://github.com/python/cpython/commit/fce5ff1e18b522cf52379934a6560583d840e7f9


--

___
Python tracker 

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



[issue36601] signals can be caught by any thread

2019-05-09 Thread miss-islington


miss-islington  added the comment:


New changeset d237b3f0f61990c972b84c45eb4fe137db51a6a7 by Miss Islington (bot) 
(Jeroen Demeyer) in branch 'master':
bpo-36601: clarify signal handler comment and remove unnecessary pid check. 
(GH-12784)
https://github.com/python/cpython/commit/d237b3f0f61990c972b84c45eb4fe137db51a6a7


--
nosy: +miss-islington

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

Paul Monson: Your initial issue has been fixed in the master branch.

I'm not sure what are Windows IoT Core and Windows Nano Server. Do you care of 
Python 3.7? If someone wants to support running test_site with ANSI code page 
set to 65001, I suggest to fix test_site directly like PR 13072 in Python 3.7. 
My attempt to avoid functools made cp65001 codec way slower. Fixing one 
specific test should not make Python that much slower ;-)

--

___
Python tracker 

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



[issue36310] pygettext3.7 Does Not Recognize gettext Calls Within fstrings

2019-05-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Of course, this wouldn't be any safer than eval'ing arbitrary user provided 
code.

--

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

About the ANSI code page, Lib/encodings/__init__.py calls _winapi.GetACP() to 
avoid relying on locale.getpreferredencoding() which lies when UTF-8 Mode is 
enabled:

import _winapi
ansi_code_page = "cp%s" % _winapi.GetACP()
if encoding == ansi_code_page:
import encodings.mbcs
return encodings.mbcs.getregentry()

INADA-san:
> So I don't think it is lie.  It is just "what encoding name we should choose 
> when GetACP() returned 65001.".
> With your PR 13230, cp65001 is truly utf-8.  So returning "utf-8" seems right 
> behavior.

Well, feel free to propose a PR. I have no strong opinion on this level of 
detail :-)

--

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-05-09 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

If you use a debugger on this, you'll discover that what is happening inside of 
mock's assert_has_calls is that it is catching and swallowing an exception 
around the inspect.Signature instances bind() call complaining about 'b' being 
an unexpected keyword argument.  Diving within the signature object being 
_used_ at the time, you find it checking against the signature of the class 
*constructor* rather than the methods. (!)

the real error here is that the mock.create_autospec(Thing) has created a mock 
of the class.  but the mock class (mock_thing) was never constructed.  Adding a 
call to the constructor makes this code work:

 mock_thing = mock.create_autospec(Thing)(constructor_param="spam")

But debugging this is insane, the error message is entirely misleading and 
shows two equal lists yet claiming they are different.

--

___
Python tracker 

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



[issue36601] signals can be caught by any thread

2019-05-09 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

PR is approved with automerge, just awaiting CI to give it the green light now.

--

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-05-09 Thread Gregory P. Smith


New submission from Gregory P. Smith :

Thing: 
mock_thing.method sig=(a=None, b=0)
F
==
FAIL: test_has_calls_on_thing (__main__.MockCallTest)
--
Traceback (most recent call last):
  File "/usr/local/google/home/gps/mock_call_test.py", line 25, in 
test_has_calls_on_thing
mock_thing.assert_has_calls([
  File "/usr/local/google/home/gps/oss/cpython/gpshead/Lib/unittest/mock.py", 
line 843, in assert_has_calls
raise AssertionError(
AssertionError: Calls not found.
Expected: [call.method(0.5, b=3000), call.method(0.6, b=6000), call.method(0.7, 
b=9000)]
Actual: [call.method(0.5, b=3000), call.method(0.6, b=6000), call.method(0.7, 
b=9000)].

See the attached mock_call_test.py.

--
components: Library (Lib)
files: mock_call_test.py
messages: 342028
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Misleading error from unittest.mock's assert_has_calls
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48323/mock_call_test.py

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d267ac20c309e37d85a986b4417aa8ab4d05dabc by Victor Stinner in 
branch 'master':
bpo-36778: cp65001 encoding becomes an alias to utf_8 (GH-13230)
https://github.com/python/cpython/commit/d267ac20c309e37d85a986b4417aa8ab4d05dabc


--

___
Python tracker 

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



[issue36601] signals can be caught by any thread

2019-05-09 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread Inada Naoki


Inada Naoki  added the comment:

> I dislike lying in the locale module. This change is basically useless with 
> my PR 13230.


Note that Python produce "cpNNN" encoding name, not Windows.
https://github.com/python/cpython/blob/137be34180a20dba53948d126b961069f299f153/Modules/_localemodule.c#L395

So I don't think it is lie.  It is just "what encoding name we should choose 
when GetACP() returned 65001.".
With your PR 13230, cp65001 is truly utf-8.  So returning "utf-8" seems right 
behavior.

--

___
Python tracker 

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



[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like the feature is only supported by a few operating systems and only 
if required functions are available:

#ifdef __APPLE__
volatile uint64_t tid;
pthread_threadid_np(NULL, );
#elif defined(__linux__)
volatile pid_t tid;
tid = syscall(__NR_gettid);

I understand that it's not available on FreeBSD nor Windows?

In that case, I would prefer to only add a threading.get_tid() *function*.

Is it different than threading.get_ident() on Linux?

--
nosy: +vstinner

___
Python tracker 

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



[issue36870] test_asyncio: test_drain_raises() fails randomly on Windows

2019-05-09 Thread STINNER Victor


New submission from STINNER Victor :

https://ci.appveyor.com/project/python/cpython/builds/24376676

ERROR: test_drain_raises (test.test_asyncio.test_streams.StreamTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_streams.py", line 820, 
in test_drain_raises
self.loop.run_until_complete(client(*addr))
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 584, in 
run_until_complete
return future.result()
  File "C:\projects\cpython\lib\test\test_asyncio\test_streams.py", line 810, 
in client
await writer.drain()
  File "C:\projects\cpython\lib\asyncio\streams.py", line 351, in drain
await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 860, in write
n = self._sock.send(data)
ConnectionAbortedError: [WinError 10053] An established connection was aborted 
by the software in your host machine

--
components: Tests
messages: 342023
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_asyncio: test_drain_raises() fails randomly on Windows
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



[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

2019-05-09 Thread Olexa Bilaniuk


Olexa Bilaniuk  added the comment:

This old bug now has a PR on Github authored by myself that may be reviewed.

--
nosy: +giampaolo.rodola, obilaniu, tarek

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread Paul Monson


Paul Monson  added the comment:

Sorry that was supposed to say:
I can verify that PR 13230 fixes the issue with test_startup_imports on Windows 
IoT Core ARM32

--

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread Paul Monson


Paul Monson  added the comment:

I can verify that PR 13110 fixes the issue with test_startup_imports on Windows 
IoT Core ARM32

--

___
Python tracker 

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



[issue35723] Add "time zone index" cache to datetime objects

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

Paul started a discussion on python-dev:
https://mail.python.org/pipermail/python-dev/2019-May/157337.html

--

___
Python tracker 

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



[issue36858] f-string '=' debugging output needs to be documented

2019-05-09 Thread Mariatta Wijaya


Mariatta Wijaya  added the comment:

Related issue where the '=' debug mode was implemented: 
https://bugs.python.org/issue36817

--
nosy: +Mariatta
stage:  -> needs patch

___
Python tracker 

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



[issue24263] unittest cannot load module whose name starts with Unicode

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

What is the current error on test_dir.tar.gz? I'm not sure which problem is 
trying to be solved here.

Why does PR 13149 use str.isidentifier() method? unittest doesn't allow 
arbitrary Unicode in filenames?

--

___
Python tracker 

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



[issue36869] Avoid warning of unused variables

2019-05-09 Thread Emmanuel Arias


New submission from Emmanuel Arias :

When run ./configure && make -j4 there are two warnings on
Object/dictobject.c file about ix and hash variable are not used.

Zachary Ware make me note that when _PyObject_ASSERT is call and NDEBUG
is defined that expand to ((void)0).

So this PR add a #ifndef check to avoid the warnings.

--
components: Build
messages: 342016
nosy: eamanu
priority: normal
pull_requests: 13141
severity: normal
status: open
title: Avoid warning of unused variables
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



[issue36829] CLI option to make PyErr_WriteUnraisable abort the current process

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Defaulting to noop when the hook fails means I'll never notice the failure to 
> be able to debug it

I'm not sure that I understood what you mean here. My PR 13187 logs a message 
into stderr is custom hook fails with a new exception. Well, then you have to 
fix your hook ;-)

--

___
Python tracker 

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



[issue36829] CLI option to make PyErr_WriteUnraisable abort the current process

2019-05-09 Thread Thomas Grainger


Thomas Grainger  added the comment:

> I'm not comfortable with forcing users to use a low-level debugger to
debug "unraisable exceptions".

Defaulting to noop when the hook fails means I'll never notice the failure
to be able to debug it

On Fri, 10 May 2019, 00:42 STINNER Victor,  wrote:

>
> STINNER Victor  added the comment:
>
> > The point for me is that CI will fail if it happens, then I can use gdb
> to find out the cause
>
> I'm not comfortable with forcing users to use a low-level debugger to
> debug "unraisable exceptions".
>
> I tried PR 13175 on the test suite by forcing the option to 1: always call
> Py_FatalError(). Many tests break:
>
> 14 tests failed:
> test_asyncio test_cmd_line test_coroutines test_cprofile
> test_exceptions test_generators test_import test_io
> test_raise test_repl test_signal test_ssl test_urllib
> test_yield_from
>
> Examples:
>
> test_error_through_destructor (test.test_io.CBufferedReaderTest) ... Fatal
> Python error: Unraisable exception
>
> FAIL: test_warn_on_full_buffer (test.test_signal.WakeupSocketSignalTests)
> FAIL: test_send_error (test.test_signal.WakeupSocketSignalTests)
> FAIL: test_wakeup_write_error (test.test_signal.WakeupSignalTests)
>
> test_unraisable (test.test_exceptions.ExceptionTests) ... Fatal Python
> error: Unraisable exception
>
> test_generators:
>
> Trying:
> del g
> Expecting nothing
> Fatal Python error: Unraisable exception
>
> etc.
>
> Unraisable exceptions are bad, but it's really hard to fix all of them.
> They are too many cases where Python is unable to pass exceptions to the
> parent.
>
> If you want to make the situation better, maybe we should investigate
> where Python cannot raise exceptions and try to make it possible.
>
> IMHO my PR 13187 adding sys.unraisablehook() is more usable/reasonable
> option.
>
> --
>
> Thomas Grainger: which code are you running on your CI? Did you try PR
> 13175 on your CI? Try it with this additional change, to always crash on
> PyErr_WriteUnraisable(). Does your CI still pass?
>
> diff --git a/Include/cpython/coreconfig.h b/Include/cpython/coreconfig.h
> index 375c0b641d..a775584553 100644
> --- a/Include/cpython/coreconfig.h
> +++ b/Include/cpython/coreconfig.h
> @@ -426,7 +426,8 @@ typedef struct {
>  .buffered_stdio = -1, \
>  ._install_importlib = 1, \
>  .check_hash_pycs_mode = NULL, \
> -._frozen = -1}
> +._frozen = -1, \
> +.abort_unraisable = 1}
>  /* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */
>
>  #ifdef __cplusplus
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue36725] Reference leak regression with Python3.8a3

2019-05-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13139

___
Python tracker 

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



[issue36719] regrtest --findleaks should fail if an uncollectable object is found

2019-05-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13140

___
Python tracker 

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



[issue34975] start_tls() difficult when using asyncio.start_server()

2019-05-09 Thread Ian Good


Ian Good  added the comment:

I added start_tls() to StreamWriter. My implementation returns a new 
StreamWriter that should be used from then on, but it could be adapted to 
modify the current writer in-place (let me know).

I've added docs, an integration test, and done some additional "real-world" 
testing with an IMAP server I work on. Specifically, "openssl s_client -connect 
xxx -starttls imap" works like a charm, and no errors/warnings are logged on 
disconnect.

--
type:  -> enhancement

___
Python tracker 

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



[issue36829] CLI option to make PyErr_WriteUnraisable abort the current process

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

> The point for me is that CI will fail if it happens, then I can use gdb to 
> find out the cause

I'm not comfortable with forcing users to use a low-level debugger to debug 
"unraisable exceptions".

I tried PR 13175 on the test suite by forcing the option to 1: always call 
Py_FatalError(). Many tests break:

14 tests failed:
test_asyncio test_cmd_line test_coroutines test_cprofile
test_exceptions test_generators test_import test_io
test_raise test_repl test_signal test_ssl test_urllib
test_yield_from

Examples:

test_error_through_destructor (test.test_io.CBufferedReaderTest) ... Fatal 
Python error: Unraisable exception

FAIL: test_warn_on_full_buffer (test.test_signal.WakeupSocketSignalTests)
FAIL: test_send_error (test.test_signal.WakeupSocketSignalTests)
FAIL: test_wakeup_write_error (test.test_signal.WakeupSignalTests)

test_unraisable (test.test_exceptions.ExceptionTests) ... Fatal Python error: 
Unraisable exception

test_generators:

Trying:
del g
Expecting nothing
Fatal Python error: Unraisable exception

etc.

Unraisable exceptions are bad, but it's really hard to fix all of them. They 
are too many cases where Python is unable to pass exceptions to the parent.

If you want to make the situation better, maybe we should investigate where 
Python cannot raise exceptions and try to make it possible.

IMHO my PR 13187 adding sys.unraisablehook() is more usable/reasonable option.

--

Thomas Grainger: which code are you running on your CI? Did you try PR 13175 on 
your CI? Try it with this additional change, to always crash on 
PyErr_WriteUnraisable(). Does your CI still pass?

diff --git a/Include/cpython/coreconfig.h b/Include/cpython/coreconfig.h
index 375c0b641d..a775584553 100644
--- a/Include/cpython/coreconfig.h
+++ b/Include/cpython/coreconfig.h
@@ -426,7 +426,8 @@ typedef struct {
 .buffered_stdio = -1, \
 ._install_importlib = 1, \
 .check_hash_pycs_mode = NULL, \
-._frozen = -1}
+._frozen = -1, \
+.abort_unraisable = 1}
 /* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */
 
 #ifdef __cplusplus

--

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread Eryk Sun


Eryk Sun  added the comment:

> I dislike lying in the locale module. This change is basically useless 
> with my PR 13230.

Yes, functionally it's no different than using 'cp65001' as an alias. That 
said, the CRT special cases 65001 as "utf8":

>>> locale.setlocale(locale.LC_CTYPE, '')
'English_United Kingdom.utf8'
>>> crt_locale = ctypes.CDLL('api-ms-win-crt-locale-l1-1-0', use_errno=True)
>>> crt_locale.___lc_codepage_func()
65001

So the suggested change makes the locale module internally consistent on 
Windows and more transparent for anyone who doesn't know off the top of their 
head that "cp65001" is just UTF-8.

--

___
Python tracker 

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



[issue36814] posix_spawn explicit file_actions=None throws error

2019-05-09 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue36843] AIX build fails with failure to get random numbers

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

Robert Boehne: pyurandom() uses _Py_open_noraise("/dev/urandom", O_RDONLY) 
which uses O_CLOEXEC if available. If this flag available? Does it work?

Please try to build attached urandom.c.

Example on my Fedora 29:

open O_RDONLY succeeded
read(16) -> 16
open O_RDONLY | O_CLOEXEC succeeded
read(16) -> 16

--
Added file: https://bugs.python.org/file48322/urandom.c

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Python could similarly special case CP_UTF8 as "utf-8" in 
> _locale._getdefaultlocale.

I dislike lying in the locale module. This change is basically useless with my 
PR 13230.

--

___
Python tracker 

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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-05-09 Thread Laurie Opperman


Laurie Opperman  added the comment:

Would this change also have to copy implemented in the new ZipFile Pathlib API? 
https://bugs.python.org/issue36832

--

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

My PR 13110 (avoid functools) makes codecs.lookup('cp65001').encode() made 2.7x 
slower:
https://github.com/python/cpython/pull/13110#issuecomment-491095964
417 ns +- 17 ns

My PR 13230 (remove cp65001.py) makes it 1.5x faster :-)
https://github.com/python/cpython/pull/13230#issuecomment-491099012
105 ns +- 3 ns

The reference is: 156 ns +- 3 ns.

--

___
Python tracker 

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



[issue36837] Make il8n tools available from `python -m`

2019-05-09 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

A note about the msgfmt problem.  It looks like GNU gettext's msgfmt has a 
similar problem but the msgfmt from pybabel does not.  This may mean that we 
need to change the gettext *Translation objects to be more tolerant of 
non-ascii encodings (perhaps defaulting to utf-8 instead of ascii).

--

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 13230 to remove Lib/encodings/cp65001.py and simply reuse 
Lib/encodings/utf_8.py.

--

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is cp65001

2019-05-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13138

___
Python tracker 

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



[issue36829] CLI option to make PyErr_WriteUnraisable abort the current process

2019-05-09 Thread Thomas Grainger


Thomas Grainger  added the comment:

The point for me is that CI will fail if it happens, then I can use gdb to
find out the cause

On Thu, 9 May 2019, 23:17 STINNER Victor,  wrote:

>
> STINNER Victor  added the comment:
>
> Ok, let me come back to the initial issue:
>
> Thomas Grainger:
> > Currently it's quite easy for these errors to go unnoticed. I'd like a
> way to easily detect these in CI. nedbat suggested piping the process
> output to another tool, and looking for 'Exception ignored in:' but this
> seems a little diff
>
> When PyErr_WriteUnraisable() is called before Python finalization, my PR
> 13187 allows to handle these exceptions: log them in a dedicated file,
> abort the process, maybe even open a network connection, etc. The hook
> allows to implement your chosen behavior.
>
> The problem is more during Python finalization: see attached
> too_late_unraisable.py example and my previous comment. If
> PyErr_WriteUnraisable() is called after sys.stderr is closed or closed to
> None, the function does nothing: the exception is not logged.
>
> The question now becomes: do *all* calls to PyErr_WriteUnraisable() must
> abort the process? What is the point? Only a very low level debugger like
> gdb can be used to see the exception.
>
> @Thomas Grainger: Do you want to have to use gdb to trace such very level
> exception?
>
> IMHO sadly when PyErr_WriteUnraisable() is called way too late, we should
> simply ignore such exceptions. And so my PR 13187 is good enough to cover
> most cases.
>
> If someone cares about exceptions raised very late during Python
> finalization, Python finalization should be enhanced. But this code is very
> fragile and is not deterministic. It is a work in progress for years to
> enhance it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue33303] ElementTree Comment text isn't escaped

2019-05-09 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


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



[issue36868] New behavior of OpenSSL hostname verification not exposed, incorrectly documented

2019-05-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue36866] Certificate verification errors in urllib.request become URLError

2019-05-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

Julien: Why not fixing Python 3.7?

You approved https://github.com/python/cpython/pull/13218 (Python 3.7 backport) 
but then you closed it. Only Azure Pipelines PR failed on "ERROR: 
test_drain_raises (test.test_asyncio.test_streams.StreamTests)" which is 
unrelated.

--

___
Python tracker 

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



[issue33303] ElementTree Comment text isn't escaped

2019-05-09 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +websurfer5

___
Python tracker 

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



[issue36829] CLI option to make PyErr_WriteUnraisable abort the current process

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, let me come back to the initial issue:

Thomas Grainger:
> Currently it's quite easy for these errors to go unnoticed. I'd like a way to 
> easily detect these in CI. nedbat suggested piping the process output to 
> another tool, and looking for 'Exception ignored in:' but this seems a little 
> diff

When PyErr_WriteUnraisable() is called before Python finalization, my PR 13187 
allows to handle these exceptions: log them in a dedicated file, abort the 
process, maybe even open a network connection, etc. The hook allows to 
implement your chosen behavior.

The problem is more during Python finalization: see attached 
too_late_unraisable.py example and my previous comment. If 
PyErr_WriteUnraisable() is called after sys.stderr is closed or closed to None, 
the function does nothing: the exception is not logged.

The question now becomes: do *all* calls to PyErr_WriteUnraisable() must abort 
the process? What is the point? Only a very low level debugger like gdb can be 
used to see the exception.

@Thomas Grainger: Do you want to have to use gdb to trace such very level 
exception?

IMHO sadly when PyErr_WriteUnraisable() is called way too late, we should 
simply ignore such exceptions. And so my PR 13187 is good enough to cover most 
cases.

If someone cares about exceptions raised very late during Python finalization, 
Python finalization should be enhanced. But this code is very fragile and is 
not deterministic. It is a work in progress for years to enhance it.

--

___
Python tracker 

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



[issue36829] CLI option to make PyErr_WriteUnraisable abort the current process

2019-05-09 Thread STINNER Victor


STINNER Victor  added the comment:

too_late_unraisable.py is an example where PyErr_WriteUnraisable() is called 
very lated during Python finalization to be handled by user code. A destructor 
(__del__) fails on print() because the stream has been closed.

PyErr_WriteUnraisable() is called by _PyGC_CollectNoFail() at the *end* of 
PyImport_Cleanup(). At this point, the sys module has already been cleared, as 
all other modules. A custom sys.unraisablehook cannot be used, because sys has 
been called.

--
versions: +Python 3.8
Added file: https://bugs.python.org/file48321/too_late_unraisable.py

___
Python tracker 

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



[issue36837] Make il8n tools available from `python -m`

2019-05-09 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

Note, I've been doing some tests of how our gettext module differs from GNU 
gettext and run into a few bugs and lack of features which make msgfmt unusable 
and limit pygettext's usefulness.

* msgfmt doesn't seem to store the charset from the .po file into the .mo file. 
 I think this might have been okay for the lgettext() and gettext() methods 
under Python2 as those probably passed the byte strings from the .mo files 
through verbatim.  Under Python3, however, we have to decode the byte strings 
to text and we can't do that without knowing the charset.  This leads to a 
UnicodeDecodeError on any .mo file which contains non-ascii characters (which 
is going to be the majority of them)

* So far, I have found that pygettext doesn't understand how to extract strings 
from ngettext().  This means that your code can't use plural forms if you want 
to use pygettext to extract the strings.

These deficiencies are probably things that need to be fixed if we're going to 
continue to promote these tools in the documentation.

--
nosy: +a.badger

___
Python tracker 

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



[issue36676] Make ET.XMLParser target aware of namespace prefixes

2019-05-09 Thread Stefan Behnel


Change by Stefan Behnel :


--
pull_requests: +13136

___
Python tracker 

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



[issue18387] Add 'symbols' link to pydoc's html menu bar.

2019-05-09 Thread Sanyam Khurana


Change by Sanyam Khurana :


--
pull_requests: +13135
stage:  -> patch review

___
Python tracker 

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



[issue36802] Revert back StreamWriter awrite/aclose but provide await writer.write() and await writer.close()

2019-05-09 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue10536] Enhancements to gettext docs

2019-05-09 Thread Julien Palard


Change by Julien Palard :


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



[issue10536] Enhancements to gettext docs

2019-05-09 Thread miss-islington


miss-islington  added the comment:


New changeset 98b360e27b0be4646ed24c5a7ac07112ca020982 by Miss Islington (bot) 
in branch '3.7':
[3.7] bpo-10536: Enhancements to gettext docs (GH-10324) (GH-13224)
https://github.com/python/cpython/commit/98b360e27b0be4646ed24c5a7ac07112ca020982


--
nosy: +miss-islington

___
Python tracker 

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



[issue36853] inconsistencies in docs builds (Sphinx 2)

2019-05-09 Thread SilentGhost


SilentGhost  added the comment:

> Second, we should probably determine why the doc builds are failing on Sphinx 
> 2 and update the `suspicious` code to support Sphinx 2.

They're failing because in sphinx 2 old and deprecated (since 1.6) custom 
logging API was removed. So all Builder.warn calls will have to be changed to 
use logging module (this applies to other similar methods, luckily they had the 
same names as logging methods).

--
nosy: +SilentGhost

___
Python tracker 

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



[issue10536] Enhancements to gettext docs

2019-05-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13134
stage:  -> patch review

___
Python tracker 

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



[issue36850] shutil.copy2 fails with even with source network filesystem not supporting extended attributes

2019-05-09 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


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

___
Python tracker 

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



[issue32523] inconsistent spacing in changelog.html

2019-05-09 Thread Julien Palard


Julien Palard  added the comment:


New changeset 137be34180a20dba53948d126b961069f299f153 by Julien Palard in 
branch 'master':
bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154)
https://github.com/python/cpython/commit/137be34180a20dba53948d126b961069f299f153


--

___
Python tracker 

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



[issue36853] inconsistencies in docs builds (Sphinx 2)

2019-05-09 Thread Julien Palard


Julien Palard  added the comment:

Hi Jaraco,

We're using sphinx 1.8 in production (docs.python.org) but we're ready for 
sphinx 2 so we should upgrade, and when we'll upgrade, we'll upgrade it 
everywhere.

You're right, `make venv` does not specify a version, at the sphinx 2 bump 
we'll have to pin it here too and try to get a single point of truth about 
which version we're using.

I've just locally ran sphinx 2.0.0 on 071cbd4ea1 (the current tip of your PR) 
and I'm not getting any error, which one are you getting?

--

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-05-09 Thread Julien Palard


Change by Julien Palard :


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



[issue36802] Revert back StreamWriter awrite/aclose but provide await writer.write() and await writer.close()

2019-05-09 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset a076e4f5e42b85664693191d04cfb33e2f9acfa5 by Andrew Svetlov in 
branch 'master':
bpo-36802: Drop awrite()/aclose(), support await write() and await close() 
instead (#13099)
https://github.com/python/cpython/commit/a076e4f5e42b85664693191d04cfb33e2f9acfa5


--

___
Python tracker 

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



[issue36853] inconsistencies in docs builds (Sphinx 2)

2019-05-09 Thread Ned Deily


Change by Ned Deily :


--
nosy: +mdk

___
Python tracker 

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



[issue36866] Certificate verification errors in urllib.request become URLError

2019-05-09 Thread Ned Deily


Change by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



[issue36868] New behavior of OpenSSL hostname verification not exposed, incorrectly documented

2019-05-09 Thread Ned Deily


Change by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



[issue36310] pygettext3.7 Does Not Recognize gettext Calls Within fstrings

2019-05-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I was going to say "use eval()", but maybe we need some sort of 
"eval_fstring()" that basically only understood f-strings and produced a 
callable that captured all of the variables (like a closure), maybe that would 
help.

--

___
Python tracker 

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



[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-09 Thread Brian Quinlan


Brian Quinlan  added the comment:

We can bike shed over the name in the PR ;-)

--

___
Python tracker 

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



[issue36310] pygettext3.7 Does Not Recognize gettext Calls Within fstrings

2019-05-09 Thread Allie Fitter


Allie Fitter  added the comment:

Just as context, my use case for this is interpolating translated strings into 
HTML.

html = f'''\
{_("Some Title")}
{_("Some longer text")}
'''

--

___
Python tracker 

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



[issue36868] New behavior of OpenSSL hostname verification not exposed, incorrectly documented

2019-05-09 Thread Josh Rosenberg


New submission from Josh Rosenberg :

The What's New in 3.7 docs mention the change from #31399 to use OpenSSL's 
built-in hostname verification ( 
https://docs.python.org/3/whatsnew/3.7.html#ssl ), but aside from that, 
information about the change is largely undiscoverable and/or wrong.

Specific problems:

1. The What's New docs repeatedly mention SSLContext.host_flags as the means of 
modifying behavior. The actual property is underscore prefixed though, as 
SSLContext._host_flags. Since SSLContext supports the creation of arbitrary 
names via __dict__, assigning to context.host_flags silently "works", it just 
fails to *do* anything (nothing ever reads it).

2. None of the flags are documented anywhere; the only way to discover them is 
to import _ssl (they're not exposed on ssl itself, just the internal C 
extension), then scan through the exposed names (they're all prefixed with 
HOSTFLAG_ AFAICT)

3. All of the flags are raw numeric values, but it seems like they should be 
IntEnums, like the other flags exposed by SSL (among other things, it would 
make it much easier to interpret the default _host_flags (currently it's just 
4, when it could display as )

4. Nothing about this change, _host_flags/host_flags, or the values of the 
flags themselves is mentioned on the ssl docs at all.

5. This unintentionally made a behavioral change (one that bit me, and may bite 
other folks using docker swarm, NETBIOS hostnames, etc.). Python's 
match_hostname implementation was fine with host names containing underscores 
(e.g. if the cert was wildcarded to *.example.com, it would match 
a_b_c.example.com just fine); they're not technically legal by the strict 
reading of the specs for host names (they're apparently legal for domain names, 
but not host names, which differ in ways I don't fully understand), but stuff 
like docker swarm names their services that way automatically, most (all?) 
browsers support visiting them, etc. It looks like OpenSSL (at least the 1.1.0g 
my Python 3.7.2 was built against) treats underscores as unmatchable, so any 
attempt to connect to such a host name in Python 3.7.2 dies with a 
SSLCertVerificationError, claiming a "Hostname mismatch, certificate is not 
valid for 'name_with_underscores.example.com'."

I discovered all this because 3.7 broke some scripts I use to connect to docker 
swarm services. Before I realized the issue was underscores, I was trying to 
figure out how to tweak the host name checks (assuming maybe something was 
broken with wildcard matching), and stumbled across all the other issues with 
the docs, the lack of flag definition exposure, etc.

For the record, I think it's reasonable to require legal host names (it was 
easy enough to fix for my case; I just updated our docker DNS server to provide 
aliases using only hyphens and changed the script to use the alias host names), 
but it would be nice if it was explicitly documented, and ideally, that Python 
itself recognize that underscores won't work and explicitly raise an exception 
saying why, rather than letting OpenSSL perform the rejection with a (to 
someone who doesn't know about the underscore issue) confusing error message.

--
assignee: docs@python
components: Documentation, Extension Modules, Library (Lib), SSL
keywords: 3.6regression
messages: 341990
nosy: christian.heimes, docs@python, josh.r, vstinner
priority: normal
severity: normal
status: open
title: New behavior of OpenSSL hostname verification not exposed, incorrectly 
documented
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



[issue36867] Make semaphore_tracker track other system resources

2019-05-09 Thread Pierre Glaser


Change by Pierre Glaser :


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

___
Python tracker 

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



[issue30262] Don't expose sqlite3 Cache and Statement

2019-05-09 Thread Berker Peksag


Change by Berker Peksag :


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

___
Python tracker 

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



[issue30262] Don't expose sqlite3 Cache and Statement

2019-05-09 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset e6576248e5174ca5daa362cfd610c07e7eb3a2ae by Berker Peksag (Aviv 
Palivoda) in branch 'master':
bpo-30262: Don't expose private objects in sqlite3 (GH-1440)
https://github.com/python/cpython/commit/e6576248e5174ca5daa362cfd610c07e7eb3a2ae


--

___
Python tracker 

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



[issue36310] pygettext3.7 Does Not Recognize gettext Calls Within fstrings

2019-05-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks for adding me, Toshio.

foo = f'{_(f"{first}, bar, and {last}")}'

Wow, that's extremely creative.

I agree that this isn't the best we can do. PEP 501 has some ideas, but it 
might be too general purpose and powerful for this. Let me think about the 
nested f-string above and see if I can't think of a better way.

As an aside, this code:

foo = _("{first}, bar, and {last}").format(**globals())

Is better written with format_map():

foo = _("{first}, bar, and {last}").format_map(globals())

It does not create a new dict like the ** version does.

--

___
Python tracker 

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



[issue36867] Make semaphore_tracker track other system resources

2019-05-09 Thread Pierre Glaser


New submission from Pierre Glaser :

Hi all,

Olivier Grisel, Thomas Moreau and myself are currently working on increasing
the range of action of the semaphore_tracker in Python.

multiprocessing.semaphore_tracker is a little known module, that launches a
server process used to track the life cycle of semaphores created in a python
session, and potentially cleanup those semaphores after all python processes of
the session terminated. Normally, python processes cleanup semaphores they
create. This is however not not guaranteed if the processes get violently
interrupted (using for example the bash command "killall python")

A note on why the semaphore_tracker was introduced: Cleaning up semaphores
after termination is important because the system only supports a limited
number of named semaphores, and they will not be automatically removed till the
next reboot.

Now, Python 3.8 introduces shared memory segments creation. Shared memory is
another sensitive global system resource. Currently, unexpected termination of
processes that created memory segments will result in leaking those memory
segments. This can be problematic for large compute clusters with many users
and that are rebooted rarely.

For this reason, we expanded the semaphore_tracker to also track shared memory
segments, and renamed it resource_tracker. Shared memory segments get
automatically tracked by the resource tracker when they are created. This is a
first, self-contained fix. (1)

Additionally, supporting shared memory tracking led to a more generic design
for the resource_tracker. The resource_tracker can be now easily extended
to track arbitrary resource types.
A public API could potentially be exposed for users willing to track other
types.  One for example may want to add tracking for temporary folders creating
during python sessions.  Another use case is the one of joblib, which
is a widely-used parallel-computing package, and also the backend of
scikit-learn. Joblib relies heavily on memmapping. A public API could extend
the resource_tracker to track memmap-ed objects with very little code.

Therefore, this issue serves two purposes:
- referencing the semaphore_tracker enhancement mentioned in (1)
- discussing a potentially public resource_tracker API.

--
components: Library (Lib)
messages: 341987
nosy: pablogsal, pierreglaser, pitrou
priority: normal
severity: normal
status: open
title: Make semaphore_tracker track other system resources
type: resource usage
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



[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2019-05-09 Thread Brian Quinlan


Change by Brian Quinlan :


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



[issue36865] FileInput does not allow 'rt' mode, but all its existing delegates do

2019-05-09 Thread Nathaniel Gaertner


Change by Nathaniel Gaertner :


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

___
Python tracker 

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



[issue36851] Frame stack is not cleaned after execution is finished with return

2019-05-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



  1   2   >