[issue36340] 3.7.3rc1 Install Certificates fails on macOS

2019-03-18 Thread Dima Tisnek


Dima Tisnek  added the comment:

I've figured out what's going on:

When Installer runs, it asks for user's su passwords, does a bunch of stuff, 
and then starts "Running package scripts".

While it's "running scripts", towards the end of that process, with "about one 
minute remaining", the Finder window pops up.

If "Install Certificates.command" is activated at that time, pip fails.

However, if user waits for "running scripts" to complete, the pip succeeds.



The "race" window is less than half a minute.

Below are the examples of site packages listing during the race window:

```
Tue Mar 19 14:20:50 JST 2019
total 8.0K
drwxr-xr-x  28 root admin  896 Mar 19 14:20 setuptools/
drwxrwxr-x   7 root admin  224 Mar 19 14:20 ./
drwxr-xr-x  10 root admin  320 Mar 19 14:20 setuptools-40.8.0.dist-info/
drwxr-xr-x   3 root admin   96 Mar 19 14:20 __pycache__/
-rw-r--r--   1 root admin  126 Mar 19 14:20 easy_install.py
drwxrwxr-x 208 root admin 6.5K Mar 13 05:13 ../
-rw-rw-r--   1 root admin  119 Mar 13 05:13 README.txt

Tue Mar 19 14:20:51 JST 2019
total 8.0K
drwxr-xr-x  11 root admin  352 Mar 19 14:20 setuptools-40.8.0.dist-info/
drwxr-xr-x   7 root admin  224 Mar 19 14:20 pkg_resources/
drwxrwxr-x   8 root admin  256 Mar 19 14:20 ./
drwxr-xr-x  42 root admin 1.4K Mar 19 14:20 setuptools/
drwxr-xr-x   3 root admin   96 Mar 19 14:20 __pycache__/
-rw-r--r--   1 root admin  126 Mar 19 14:20 easy_install.py
drwxrwxr-x 208 root admin 6.5K Mar 13 05:13 ../
-rw-rw-r--   1 root admin  119 Mar 13 05:13 README.txt

Tue Mar 19 14:20:52 JST 2019
total 8.0K
drwxr-xr-x   6 root admin  192 Mar 19 14:20 pip/
drwxrwxr-x   9 root admin  288 Mar 19 14:20 ./
drwxr-xr-x  11 root admin  352 Mar 19 14:20 setuptools-40.8.0.dist-info/
drwxr-xr-x   7 root admin  224 Mar 19 14:20 pkg_resources/
drwxr-xr-x  42 root admin 1.4K Mar 19 14:20 setuptools/
drwxr-xr-x   3 root admin   96 Mar 19 14:20 __pycache__/
-rw-r--r--   1 root admin  126 Mar 19 14:20 easy_install.py
drwxrwxr-x 208 root admin 6.5K Mar 13 05:13 ../
-rw-rw-r--   1 root admin  119 Mar 13 05:13 README.txt

Tue Mar 19 14:20:53 JST 2019
total 8.0K
drwxr-xr-x   3 root admin   96 Mar 19 14:20 __pycache__/
drwxr-xr-x   9 root admin  288 Mar 19 14:20 pip-19.0.3.dist-info/
drwxrwxr-x  10 root admin  320 Mar 19 14:20 ./
drwxr-xr-x   7 root admin  224 Mar 19 14:20 pip/
drwxr-xr-x  11 root admin  352 Mar 19 14:20 setuptools-40.8.0.dist-info/
drwxr-xr-x   7 root admin  224 Mar 19 14:20 pkg_resources/
drwxr-xr-x  42 root admin 1.4K Mar 19 14:20 setuptools/
-rw-r--r--   1 root admin  126 Mar 19 14:20 easy_install.py
drwxrwxr-x 208 root admin 6.5K Mar 13 05:13 ../
-rw-rw-r--   1 root admin  119 Mar 13 05:13 README.txt
```



I suspect that this is not a big deal in practice, because a new user would not 
know to run the command until instructed in the "installation completed" screen.

Meanwhile, "experienced / trigger-happy" users probably know to run the command 
again :)



P.S. I'm also wondering if it matters that installer asks for current user's su 
password and after a good installation, most content of site-packages is owned 
by root:admin, while certifi is owned by current user... For example 
`__pycache__` not being writable by user.

--
Added file: https://bugs.python.org/file48218/Screenshot 2019-03-19 at 
14.08.31.png

___
Python tracker 

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



[issue36315] Unable to install Python 3.7.2

2019-03-18 Thread Steve Dower


Steve Dower  added the comment:

In your %TEMP% directory, there should be at least one more log file (probably 
only one other) alongside the one you attached. It will have "core_JustForMe" 
in the title. Could you find and attach this file? It has the actual cause of 
the error in it.

--

___
Python tracker 

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



[issue36357] Build 32bit Python on Windows with SSE2 instruction set

2019-03-18 Thread Ma Lin


New submission from Ma Lin :

On windows, it seems 32bit builds (3.7.2/3.8.0a2) don't using SSE2 sufficiently.

I test on 3.8 branch, python38.dll only uses XMM register 28 times. The 
official build is the same.
After enable this option, python38.dll uses XMM register 11,704 times.

--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -88,6 +88,7 @@
   $(zlibDir);%(AdditionalIncludeDirectories)
   
_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)
   _Py_HAVE_ZLIB;%(PreprocessorDefinitions)
+  StreamingSIMDExtensions2
 
 
   
version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)

x86 instruction set has only a few number of registers.
In my understanding, using XMM registers on 32bit build will brings a small 
speed up.
I'm not an expert of this kind knowledge, sorry if I'm wrong.

--
components: Build, Windows
messages: 338317
nosy: Ma Lin, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Build 32bit Python on Windows with SSE2 instruction set
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



[issue26789] Please do not log during shutdown

2019-03-18 Thread Peer Sommerlund


Change by Peer Sommerlund :


--
nosy: +Peer Sommerlund

___
Python tracker 

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



[issue36340] 3.7.3rc1 Install Certificates fails on macOS

2019-03-18 Thread Ned Deily


Ned Deily  added the comment:

At first glance, I'm not sure what happened here; we do try to make Install 
Certificates as bulletproof as possible.  As you probably know, clicking on the 
file causes it to be opened with the macOS application that Launch Services 
determines is appropriate.  By default, .command files are associated with 
Terminal.app (which can be verified by using the Finder's Get Info command on 
the .command file).  Now apparently you have installed the fish shell 
(something Apple doesn't ship with macOS) and have changed Terminal.app's 
preferences or your user account to use fish as the default shell.  The Install 
Certificates command is a shebang line that should cause it to be executed with 
the newly-installed Python and that seems to have happened.  But then for some 
reason, the vendored urllib3 could not be imported correctly.  If you were able 
to successfully run "Install Certificates.command" from a regular terminal 
window - without having reinstalled pip - that sounds like some sort of per
 missions problems which should not happen. Or some other sort of shell startup 
difference (although the script invokes python with -E to ignore PYTHON* env 
vars).  Ah, but I now notice you say your normal terminal window is an iTerm2 
one.  So, if when double-clicking, the command file runs under Terminal.app but 
when you run in manually, it's under iTerm2, there *might* be some discrepancy 
there - I'm not sure what.  One easy thing to try: now that certifi was 
successfully installed, what happens if you try rerunning the command by 
double-clicking it?  Does it still fail in the same way?  If so, it would be 
interesting to get more info on the environment the failing command is running 
in.  Perhaps the easiest way to do that would be to make a copy of the command 
file and modify it to do:

subprocess.check_call([sys.executable,
"-E", "-s", "-m", "test.pythoninfo"])

just prior to the check_call to install certifi.  As it stands, I'm unable to 
reproduce the failure with a vanilla macOS system without intentionally 
modifying permissions etc.

--
assignee:  -> ned.deily
stage:  -> test needed

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-03-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-03-18 Thread Ben Harper


Change by Ben Harper :


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

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-03-18 Thread Ben Harper


New submission from Ben Harper :

Trying to run make after './configure --with-address-sanitizer --with-pydebug' 
fails with leak of locale string

--
components: Build
messages: 338315
nosy: btharper
priority: normal
severity: normal
status: open
title: Failure to build with address sanitizer
type: compile error
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



[issue36324] Inverse cumulative normal distribution function

2019-03-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks Steven.

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



[issue36324] Inverse cumulative normal distribution function

2019-03-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 714c60d7aca6d0f6d73ad2d7c876d2d683a7fce3 by Raymond Hettinger in 
branch 'master':
bpo-36324: Add inv_cdf() to statistics.NormalDist() (GH-12377)
https://github.com/python/cpython/commit/714c60d7aca6d0f6d73ad2d7c876d2d683a7fce3


--

___
Python tracker 

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



[issue36344] install_certificates.command too complicated, copy from pip's dir instead

2019-03-18 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the suggestion but that is not a workable solution for two reasons. 
One, pip is an optional install with the python.org installer so we cannot 
depend on it being available.  More importantly, from a packaging point of 
view, the internal composition of pip is opaque.  There's no guarantee that any 
future release of pip will still bundle root certificates, that they will be 
installed in the same location, or which root certificates will be included and 
how up-to-date they are. Pip uses the certificates primarily to access PyPI, 
not to provide a general set of root certificates.  The current python.org 
solution of providing the Install Certificates script as an example is 
certainly far from ideal and we will improve it.  But adding a dependency on 
undocumented behavior of pip is not a step in the right direction.

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



[issue36131] test.test_urllib2net.TimeoutTest ftp related tests fail due to ftp://www.pythontest.net/ being unavailable

2019-03-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

A similar issue happened again on s390x SLES 2.7:

https://buildbot.python.org/all/#/builders/66/builds/373

--

___
Python tracker 

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



[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12379

___
Python tracker 

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



[issue36352] Modules/getpath.c should not use hardcoded buffer sizes (MAXPATHLEN)

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset faddaedd05ca81a9fed3f315e7bc8dcf455824a2 by Victor Stinner in 
branch 'master':
bpo-36352: Avoid hardcoded MAXPATHLEN size in getpath.c (GH-12423)
https://github.com/python/cpython/commit/faddaedd05ca81a9fed3f315e7bc8dcf455824a2


--

___
Python tracker 

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



[issue36352] Modules/getpath.c should not use hardcoded buffer sizes (MAXPATHLEN)

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

These changes are intrusive. I don't think that it's worth it to backport them 
to 3.7 (or 2.7). Just don't play with paths close to MAXPATHLEN bytes on Python 
2.7 or 3.7 :-) 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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread STINNER Victor

STINNER Victor  added the comment:

Thanks Stéphane for the quick fix, I merged your PR. Thanks kmiku7 for your bug 
report.

Until the next Python 2.7 version is released, you can use Python 3 which is 
already fixed ;-)

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset f70b884ad70e2ce762842ae469f88bd48fe13998 by Victor Stinner 
(Stéphane Wirtel) in branch '2.7':
bpo-36337: socket.send()/sendall() use Py_ssize_t (GH-12397)
https://github.com/python/cpython/commit/f70b884ad70e2ce762842ae469f88bd48fe13998


--

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-03-18 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Looks good to me.

Later I will do some spot checks against the results returned by the Nspire 
calculator, but in the meantime I think this can go in. Thanks for your efforts 
Raymond, I think this NormalDist is shaping up to be a great addition.

--

___
Python tracker 

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



[issue36309] Remove tempfile.mktemp()

2019-03-18 Thread John Hagen


John Hagen  added the comment:

Should it be a DeprecationWarning instead of a RuntimeWarning? (or both since 
it's both deprecated and a security issue?)

--

___
Python tracker 

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



[issue36309] Remove tempfile.mktemp()

2019-03-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

There was a warning, but it was suppressed by this commit:

commit 44f602dd3b452bbacd3c85b1e5f9873c892b46e3
Author: Guido van Rossum 
Date:   Fri Nov 22 15:56:29 2002 +

Comment out the warnings about mktemp().  These are too annoying, and
often unavoidable.

diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 97f125250b..0393ba5d30 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -324,9 +324,9 @@ def mktemp(suffix="", prefix=template, dir=None):
 the punch.
 """

-from warnings import warn as _warn
-_warn("mktemp is a potential security risk to your program",
-  RuntimeWarning, stacklevel=2)
+##from warnings import warn as _warn
+##_warn("mktemp is a potential security risk to your program",
+##  RuntimeWarning, stacklevel=2)

 if dir is None:
 dir = gettempdir()

--
nosy: +pablogsal

___
Python tracker 

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



[issue36301] Add _Py_PreInitialize() function

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5f9cf23502febe0eb3bc02e45c7d2bfc79424757 by Victor Stinner in 
branch 'master':
bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)
https://github.com/python/cpython/commit/5f9cf23502febe0eb3bc02e45c7d2bfc79424757


--

___
Python tracker 

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



[issue36352] Modules/getpath.c should not use hardcoded buffer sizes (MAXPATHLEN)

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12378

___
Python tracker 

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



[issue36309] Remove tempfile.mktemp()

2019-03-18 Thread Brett Cannon


Brett Cannon  added the comment:

Unfortunately not because there is no warning being raised currently about the 
deprecation (it's only documented as deprecated; 
https://github.com/python/cpython/commit/44f602dd3b452bbacd3c85b1e5f9873c892b46e3).
 A PR raising an appropriate deprecation for at least one release would then 
allow us to consider removing it in subsequent release.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yup. But what is the best way to signal the caller that 
_PyPathConfig_ComputeArgv0 has failed because _Py_wgetcwd has failed without 
changing the API massively? 

Right now if _PyPathConfig_ComputeArgv0 returns null is assumed that is due to 
a memory error when calling PyUnicode_FromWideChar. So either we stop returning 
_Py_INIT_NO_MEMORY() and then skip appending to sys_path or we change the API 
to signal different problems to the caller.

Also, notice that the same function is used in sysmodule.c in PySys_SetArgvEx:

If argv[0] is not '-c' nor '-m', prepend argv[0] to sys.path.

--

___
Python tracker 

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



[issue36315] Unable to install Python 3.7.2

2019-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue36301] Add _Py_PreInitialize() function

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12377

___
Python tracker 

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



[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Oh. It seems like I misunderstood the issue. I read "argv0" as sys.argv[0], but 
_PyPathConfig_ComputeArgv0 is used to insert a value at the start of sys.path. 
That's different...

If the current directory has been removed, sys.path should just be left 
unchanged, no?

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> one looks tricky to fix (docutils)

Actually, it is really easy to fix just by updating the target comparison files 
(that is the procedure described in the comments for the test).

What is taking more thought is coming up with a better test that verifies 
intended semantic content rather than the exact serialization.  I'm working 
with Stéphane to figure out how to do this.

--

___
Python tracker 

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



[issue36207] robotsparser deny all with some rules

2019-03-18 Thread wats0ns


wats0ns  added the comment:

I can't find a documentation about it, but all of the robots.txt checkers I 
find behave like this. You can test on this site: 
http://www.eskimoz.fr/robots.txt, I believe that this is how it's implemented 
now in most parsers ?

--

___
Python tracker 

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



[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

If we set argv0 to ".":

 if (_Py_wgetcwd(fullpath, Py_ARRAY_LENGTH(fullpath))) {
argv0 = fullpath;
n = wcslen(argv0);
 }
 else {
argv0 = L".";
n = 1;
 }

then the caller does not have any way of knowing if the returned argv0 is due
to the fact that _Py_wgetcwd failed so it will blindly add "." to sys.path 
unless
we set the result using PyObject** and then returning some error code to signal
what happened (or something similar). On the other hand, I do not like this API,
because returning some error code != 0 from _PyPathConfig_ComputeArgv0 would be
weird because the call actually succeeded (it has returned "." as the value for 
argv0).

What do you think is the best way to signal pymain_run_python that the current 
directory
does not exist (because _Py_wgetcwd has failed)?

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread Julien Palard


Julien Palard  added the comment:

We found two occurrences of external code breaking due to this change, and one 
looks tricky to fix (docutils), this indicates there are other library that 
will break.

> My (somewhat educated) gut feeling is that most users simply won't care or 
> won't even notice the change.

I concur with this. Why changing the default behavior? The costs of changing 
this looks high, and the benefits looks very low (people not noticing).

As already proposed, a keyword-only `sorted` parameter defaulting to True (the 
current behavior) would allow one to give False and get control of ordering, 
and won't break any existing library.

On the plus side `sorted=True` makes the current behavior (sorted by default) 
more discoverable.

--
nosy: +mdk

___
Python tracker 

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



[issue36352] Modules/getpath.c should not use hardcoded buffer sizes (MAXPATHLEN)

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7b14f0c02ce9d919c503119db190dbca0e703393 by Victor Stinner in 
branch 'master':
bpo-36352: Add error handling to getpath.c (GH-12421)
https://github.com/python/cpython/commit/7b14f0c02ce9d919c503119db190dbca0e703393


--

___
Python tracker 

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



[issue36352] Modules/getpath.c should not use hardcoded buffer sizes (MAXPATHLEN)

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@raymond

Here is a basic comparison between two xml streams.

Maybe we could propose this solution when we want to compare an XML with 
xml.dom.minidom instead of the byte-to-byte comparison.

--
Added file: https://bugs.python.org/file48217/test_xml_compare.py

___
Python tracker 

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



[issue36207] robotsparser deny all with some rules

2019-03-18 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Can you provide a link to documentation showing that "Disallow: ?" shouldn't be 
the same as deny all?  Thanks!

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'll make a post to python-dev so that we can escalate the discussion and get 
broader participation.  Personally, I'm not wedded to any one particular 
outcome and just want to do what is best for the users in the long run.

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Victor, as much as I appreciate backwards compatibility, I really don't think 
> it's a big deal in this case.

In short, the XML serialization is no longer deterministic. It depends in which 
order attributes are defined. Example:
---
from xml.etree import ElementTree as ET

document = ET.Element('document')
document.attrib['a'] = '1'
document.attrib['b'] = '2'
ET.dump(document)

document = ET.Element('document')
document.attrib['b'] = '2'
document.attrib['a'] = '1'
ET.dump(document)
---

Python 3.7 output:
---


---

Python 3.8 output:
---


---

On this example, it's obvious that the attributes are defined in a different 
order, but the code which generates the XML document can be way more complex 
and use unordered data structures like set().

Why does it matter? Most programs compare XML using basic string comparison, 
they don't implement smart XML comparison which ignore attributes order.

Concrete example:

* A program which rewrites the XML on disk if attribute order changes (useless 
disk write).
* Version Control System (Git, hg, svn, whatever) sees the file as modified and 
produces a change which can be unexpected and annoy users (use more disk space, 
more network bandwidth, etc.)
* https://reproducible-builds.org/
* It breaks docutils unit tests which uses straightfoward assertEqual(). 
docutils is just one example: it's not hard to imagine many other applications 
using XML and which use a similar check.
* etc.

It's not just a matter of parsers.


> My (somewhat educated) gut feeling is that most users simply won't care or 
> won't even notice the change.

... Really? Why do you think that so many people are involved in this issue if 
nobody cares of XML attribute order? :-)

--

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 18.03.2019 22:33, Stefan Behnel wrote:
> 
> I had also looked through the unrelated changes, and while, yes, they are 
> unrelated, they seemed to be correct and reasonable modernisations of the 
> code base while touching it. They could be moved to a separate PR, but there 
> is a relatively high risk of conflicts, so I'm ok with keeping them in here 
> for now.

I don't think changing sequence iteration to list iteration only
is something that should be hidden in a wchar_t removal PR.

My guess is that these changes have made it into the PR by mistake.
They deserve a separate PR and discussion.

--

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Stefan Behnel


Stefan Behnel  added the comment:

I had also looked through the unrelated changes, and while, yes, they are 
unrelated, they seemed to be correct and reasonable modernisations of the code 
base while touching it. They could be moved to a separate PR, but there is a 
relatively high risk of conflicts, so I'm ok with keeping them in here for now.

--

___
Python tracker 

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



[issue36301] Add _Py_PreInitialize() function

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c183444f7e2640b054956474d71aae6e8d31a543 by Victor Stinner in 
branch 'master':
bpo-36301: Fix Py_Main() memory leaks (GH-12420)
https://github.com/python/cpython/commit/c183444f7e2640b054956474d71aae6e8d31a543


--

___
Python tracker 

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



[issue36333] memory leaks detected with valgrind for python -V

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c183444f7e2640b054956474d71aae6e8d31a543 by Victor Stinner in 
branch 'master':
bpo-36301: Fix Py_Main() memory leaks (GH-12420)
https://github.com/python/cpython/commit/c183444f7e2640b054956474d71aae6e8d31a543


--

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

I'd change the title of this bpo item to "Prepare for removing the whcar_t 
caching in the Unicode C API".

Note that the wchar_t caching was put in place to allow for external 
applications and C code to easily and efficiently interface with Python. By 
removing it you will slow down such code significantly, esp. on Linux and 
Windows where wchar_t code is fairly common (one of the reasons we added UCS4 
in Python was to make the interaction with Linux wchar_t code more efficient).

This should be clearly mentioned as part of the change and the compile time 
flags.


BTW: You have a few other changes in the PR which don't have anything to do 
with the intended removal:

-envsize = PySequence_Fast_GET_SIZE(keys);
-if (PySequence_Fast_GET_SIZE(values) != envsize) {
+envsize = PyList_GET_SIZE(keys);
+if (PyList_GET_SIZE(values) != envsize) {

--
nosy: +lemburg

___
Python tracker 

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



[issue36301] Add _Py_PreInitialize() function

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12374

___
Python tracker 

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



[issue36333] memory leaks detected with valgrind for python -V

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12375

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Stefan Behnel


Stefan Behnel  added the comment:

I think this is a good preparation that makes it clear what code will 
eventually be removed, and allows testing without it.

No idea how happy Windows users will be about all of this, but I consider it 
quite an overall improvement for the Unicode implementation. Once this gets 
removed, that is.

Removing the "unicode_internal" codec entirely (which is changed by this PR) is 
discussed in issue36297.

--

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Stefan Behnel


Stefan Behnel  added the comment:

Thanks for implementing this, Serhiy.
Since these C macros are public, should they be named PY_* ?

--

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Stefan Behnel


Change by Stefan Behnel :


--
nosy: +scoder

___
Python tracker 

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



[issue36355] Remove documentation and internal use of the *RESTRICTED constants for PyMemberDef's flags field

2019-03-18 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

To be clear, only the constants that include the substring RESTRICTED are 
useless; READONLY remains useful and should not be removed (though per my 
suggestion on #36347, it might be good to add an alias for it named PY_READONLY 
to match the Python C API naming conventions).

--
title: Remove documentation and internal use of the RESTRICTED constants for 
PyMemberDef's flags field -> Remove documentation and internal use of the 
*RESTRICTED constants for PyMemberDef's flags field

___
Python tracker 

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



[issue36355] Remove documentation and internal use of the RESTRICTED constants for PyMemberDef's flags field

2019-03-18 Thread Josh Rosenberg


New submission from Josh Rosenberg :

While looking up background info for #36347, I noticed that the docs for 
PyMemberDef ( 
https://docs.python.org/3/extending/newtypes.html#generic-attribute-management 
) define the following flags:

* READONLY
* READ_RESTRICTED
* WRITE_RESTRICTED
* RESTRICTED

Of those, WRITE_RESTRICTED has been documented incorrectly since Python 3.0a2 
(it got renamed to PY_WRITE_RESTRICTED in structmember.h, apparently due to a 
name clash with VS 2008 on Windows).

Luckily, the constants are useless; AFAICT they were there solely to support 
restricted mode (via the rexec and Bastion modules). The modules were 
apparently disabled in Python 2.3 "due to various known and not readily fixable 
security holes" ( https://docs.python.org/2/library/restricted.html ), and the 
modules themselves officially deprecated in 2.6, and removed completely in 3.0.

Rather than fixing up the docs, maybe it's time to kill these constants for 
good? Probably shouldn't remove the definitions in structmember.h (if someone 
wrote code using them, we shouldn't needlessly break compilation), but the 
interpreter and standard library should stop setting them, and the 
documentation for them should be removed.

--
assignee: docs@python
components: Documentation, Extension Modules, Interpreter Core
messages: 338282
nosy: docs@python, josh.r
priority: normal
severity: normal
status: open
title: Remove documentation and internal use of the RESTRICTED constants for 
PyMemberDef's flags field
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



[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

2019-03-18 Thread Demian Brecht


Demian Brecht  added the comment:

@xtreak sure, can do. May not have time to do so today but should be able to do 
so over the next couple days.

--

___
Python tracker 

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



[issue24565] the f_lineno getter is broken

2019-03-18 Thread Xavier de Gaye


Change by Xavier de Gaye :


--
pull_requests: +12373

___
Python tracker 

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



[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-18 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Serhiy: Problem is that READONLY already exists, so PY_READWRITE would be 
inconsistent.

Given currently READONLY is just defined as:

#define READONLY 1

I suppose a solution to maintain consistency (of a sort) would be to add the 
definitions:

#define PY_READWRITE 0
#define PY_READONLY 1

leaving READONLY defined as well for backwards compatibility.

Names chosen are public names, since I'm pretty sure READONLY is considered 
part of the public API, given that PyMemberDef and its fields definitely are, 
and it would be impossible to use the flags field correctly if READONLY wasn't 
part of the public API.

--
nosy: +josh.r

___
Python tracker 

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



[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-18 Thread Paul Moore


Paul Moore  added the comment:

Thanks! That seems to have done it. Update to the PR incoming once my test 
build completes.

--

___
Python tracker 

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



[issue36318] Adding support for setting the "disabled" attribute of loggers from logging.config.dictConfig

2019-03-18 Thread Vinay Sajip


Vinay Sajip  added the comment:

> If the `disabled` attribute should not be part of the public API it should 
> have been name `_disabled`.

A bit late for that now, and AFAIK it hasn't caused people insuperable problems 
heretofore - the code has been like this pretty much since the logging package 
was added to Python.


> So it should be doable from `logging.config.dictConfig` too in my opinion.

Let's just agree to disagree on this for now. It's certainly not a common use 
case, there are other ways to achieve the desired result in those uncommon 
cases, and the argument seems to come back to "consistency". I'd rather leave 
this as it is.

--

___
Python tracker 

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



[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

2019-03-18 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This issue is still reproducible on master and below is a unittest. The patch 
looks reasonable to me and fixes the issue. @demian.brecht, would you like to 
convert the patch to a PR ?

diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py
index 22bf41cf1d..3540a3d94f 100644
--- a/Lib/test/test_http_cookiejar.py
+++ b/Lib/test/test_http_cookiejar.py
@@ -585,6 +585,13 @@ class CookieTests(unittest.TestCase):
 # if expires is in future, keep cookie...
 c = CookieJar()
 future = time2netscape(time.time()+3600)
+
+headers = ["Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/; 
expires={0}".format(future)]
+req = urllib.request.Request("http://www.coyote.com/;)
+res = FakeResponse(headers, "http://www.coyote.com/;)
+cookies = c.make_cookies(res, req)
+
+c = CookieJar()
 interact_netscape(c, "http://www.acme.com/;, 'spam="bar"; expires=%s' %
   future)
 self.assertEqual(len(c), 1)

$ ./python.exe -m unittest -v test.test_http_cookiejar.CookieTests.test_expires
test_expires (test.test_http_cookiejar.CookieTests) ... 
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/http/cookiejar.py:1619: 
UserWarning: http.cookiejar bug!
Traceback (most recent call last):
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/http/cookiejar.py", 
line 1616, in make_cookies
ns_cookies = self._cookies_from_attrs_set(
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/http/cookiejar.py", 
line 1574, in _cookies_from_attrs_set
cookie = self._cookie_from_cookie_tuple(tup, request)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/http/cookiejar.py", 
line 1546, in _cookie_from_cookie_tuple
elif expires <= self._now:
AttributeError: 'CookieJar' object has no attribute '_now'

  _warn_unhandled_exception()
ok

--
Ran 1 test in 0.043s

OK

--
nosy: +xtreak
versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



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

2019-03-18 Thread Julien Palard


Julien Palard  added the comment:

If it's appreciated as a demo for wsgiref, wouldn't it be better to move it 
inside Doc/library/wsgiref.rst?

It was written specifically for the Doc/Makefile, it's no longer needed for the 
Doc/Makefile, so the question pops: is it usefull to anyone? If not it's better 
to drop it (or move it to the documentation as a nice, time-proven example).

--

___
Python tracker 

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



[issue35605] backported patch requires new sphinx, minimum sphinx version was not bumped

2019-03-18 Thread Julien Palard


Julien Palard  added the comment:


New changeset 869652b426bb34a30ce7b39f0a0ac242ed5b1016 by Julien Palard in 
branch '2.7':
[2.7] bpo-35605: Fix documentation build for sphinx<1.6 (GH-12413)
https://github.com/python/cpython/commit/869652b426bb34a30ce7b39f0a0ac242ed5b1016


--

___
Python tracker 

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



[issue36292] Coverity scan: Resource leaks in longobject.c

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

I hope that the change will satisfy the god of static analyzers :-)

I discussed with Charalampos and we agreed to not backport this change, since 
it's a false alarm and not a real bug. 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



[issue36292] Coverity scan: Resource leaks in longobject.c

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a10d426bab66a4e1f20d5e1b9aee3dbb435cf309 by Victor Stinner 
(stratakis) in branch 'master':
bpo-36292:  Mark unreachable code as such in long bitwise ops (GH-12333)
https://github.com/python/cpython/commit/a10d426bab66a4e1f20d5e1b9aee3dbb435cf309


--

___
Python tracker 

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



[issue32223] distutils doesn't correctly read UTF-8 content from config files

2019-03-18 Thread Éric Araujo

Éric Araujo  added the comment:

Repeat: `metadata` in setup.cfg is not supported directly by distutils.  Can 
you provide a setup.py script that shows the problem without setuptools?

--

___
Python tracker 

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



[issue36354] Use CreateProcessW for Python 2.7 on Windows.

2019-03-18 Thread Ray Donnelly


Ray Donnelly  added the comment:

.. and alternative to my ACP idea would be to use `GetACP()` or 
`getfilesystemencoding()` .. or? Suggestions welcome!

--

___
Python tracker 

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



[issue36354] Use CreateProcessW for Python 2.7 on Windows.

2019-03-18 Thread Ray Donnelly


New submission from Ray Donnelly :

Hi all,

I'd like to entertain some discussion around the idea of calling CreateProcessW 
instead of CreateProcess on Windows.

I've written a patch as a proof of concept and I would love to get some 
feedback. I guess I've broken the normal ACP/getfilesystemencoding() 
expectation for byte strings here. My idea to fix this was to use 
CreateProcessW only when all arguments (program name, arguments, cwd, 
environment) are unicode already.

The reason we'd like to use it on Anaconda Distribution is that we would like 
for conda to be able to handle Unicode as well as possible in as many 
situations as possible, including running a Python2 conda and creating conda 
envs with all sorts of glyphs in it.

We run into bug reports quite frequently from people who try to install 
Miniconda2 or Anaconda2 in their home directories due to their username 
containing certain codepoints.

--
files: 0017-Use-CreateProcessW-to-support-Unicode.patch
keywords: patch
messages: 338270
nosy: Ray Donnelly, giampaolo.rodola, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Use CreateProcessW for Python 2.7 on Windows.
Added file: 
https://bugs.python.org/file48216/0017-Use-CreateProcessW-to-support-Unicode.patch

___
Python tracker 

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



[issue36353] rpath incorrectly handled on OSX by build_ext

2019-03-18 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread Stefan Behnel


Stefan Behnel  added the comment:

Victor, as much as I appreciate backwards compatibility, I really don't think 
it's a big deal in this case. In fact, it might not even apply.

My (somewhat educated) gut feeling is that most users simply won't care or 
won't even notice the change. Out of those who do (or have to) care, many are 
better off by fixing their code to not rely on an entirely arbitrary (sorted by 
name) attribute order than by getting the old behaviour back. And for those few 
who really need attributes to be sorted by name, there's the recipe I posted 
which works on all ElementTree implementations out there with all alive CPython 
versions.

> This recipe does modify the document and so changes the behaviour of the 
> application when it iterates on attributes later

This is actually a very rare thing. If I were to make up numbers, I'd guess 
that some 99% of the applications do XML serialisation as the last thing and 
then throw away the tree afterwards, without touching it (or its attributes) 
again. And the remaining cases are most probably covered by the "don't need to 
care" type of users. I don't think we should optimise for 0.05% of our user 
base by providing a new API option for them. Especially in ElementTree, which 
decidedly aims to be simple.

The example that Ned gave refers to a very specific and narrow case: comparing 
serialised XML, at the byte level, in tests. He was very lucky that ElementTree 
was so stable over the last 10 Python releases that the output did not change 
at all. That is not something that an XML library needs to guarantee. There is 
some ambiguity in XML for everything that's outside of the XML Information set, 
and there is a good reason why the W3C has tackled this ambiguity with an 
explicit and *separate* specification: C14N. So, when you write:

> Many XML parsers rely on the order of attributes

It's certainly not many parsers, and could even be close to none. The order of 
attributes is explicitly excluded from the XML Information set:

https://www.w3.org/TR/xml-infoset/#omitted

Despite this, cases where the order of the attributes matters to the 
*application* are not unheard of. But for them, attributes sorted by their name 
are most likely the problem and not a solution. Raymond mentioned one such 
example. Sorting attributes by their name really only fulfils a single purpose: 
to get reproducible output in cases where the order does *not* matter. For all 
the (few) cases where the order *does* matter, it gets in the way.

But by removing the sorting, as this change does, we still get predictable 
output due to dict ordering. So this use case is still covered. It's just not 
necessarily the same output as before, because now the ordering is entirely in 
the hands of the users. Meaning, those users who *do* care can now actually 
influence the ordering, which was very difficult and hackish to achieve before. 
We are allowing users to remove these hacks, not forcing them to add new ones.

--

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

Oh, I didn't know the bot is not working for now. Thank you for making the test 
more robust!

--

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the review, I merged my PR and the test enhancements.

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8c380e99e9b71387d5722373805fe3159e2d912c by Victor Stinner in 
branch '2.7':
bpo-36235: Enhance distutils test_customize_compiler() (GH-12403) (GH-12417)
https://github.com/python/cpython/commit/8c380e99e9b71387d5722373805fe3159e2d912c


--

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset dd1cfefd67f254ce44f33995922e347c9d3f7b4e by Victor Stinner in 
branch '3.7':
bpo-36235: Enhance distutils test_customize_compiler() (GH-12403) (GH-12415)
https://github.com/python/cpython/commit/dd1cfefd67f254ce44f33995922e347c9d3f7b4e


--

___
Python tracker 

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



[issue969718] BASECFLAGS are not passed to module build line

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

This issue has been fixed by bpo-36235.

--
nosy: +vstinner
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> distutils.sysconfig.customize_compiler() overrides CFLAGS var 
with OPT var if CFLAGS env var is set

___
Python tracker 

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



[issue36353] rpath incorrectly handled on OSX by build_ext

2019-03-18 Thread Toon Verstraelen


New submission from Toon Verstraelen :

When using the '-R' option of build_ext on OSX, e.g.

python setup.py -R some/path

it gets translated to the following clang compiler argument:

-L some/path

while it should be

-Wl,-rpath,some/path

See clang documentation for details: 

https://clang.llvm.org/docs/ClangCommandLineReference.html#linker-flags

--
components: Distutils
messages: 338263
nosy: Toon Verstraelen, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: rpath incorrectly handled on OSX by build_ext
type: behavior

___
Python tracker 

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



[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-18 Thread Steve Dower


Steve Dower  added the comment:

> I ran Tools/nuget/build.bat manually, and the resulting file didn't have 
> lib\venv in it (I opened it in 7-zip, I don't know how to install a local 
> nuget file...).

Huh, Tools/nuget/make_pkg.proj doesn't use the preset for some reason. I 
don't remember why not, so maybe add all the options listed in that file 
into the preset as well and then update the command in make_pkg.proj to 
just have "--preset-nuget".

--

___
Python tracker 

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



[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It does not follow the convention for names in the C API. All public names 
should have prefix Py or PY, all private user visible names should have prefix 
_Py or _PY.

Some existing names do not follow that convention, but we should fix this and 
do not add new exceptions.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23984] Documentation error: Descriptors

2019-03-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, I'm in the middle of a major update to this howto add will address this 
example there.

--
resolution:  -> postponed

___
Python tracker 

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



[issue36320] typing.NamedTuple to switch from OrderedDict to regular dict

2019-03-18 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



[issue36320] typing.NamedTuple to switch from OrderedDict to regular dict

2019-03-18 Thread miss-islington


miss-islington  added the comment:


New changeset f7b57df0c09c3a04ab27ba06eb2feb989bbb16cb by Miss Islington (bot) 
(Raymond Hettinger) in branch 'master':
bpo-36320: Switch typing.NamedTuple from OrderedDict to regular dict (GH-12396)
https://github.com/python/cpython/commit/f7b57df0c09c3a04ab27ba06eb2feb989bbb16cb


--
nosy: +miss-islington

___
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-03-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I disagree with deprecating serve.py. It is a demo for the wsgiref module.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36352] Modules/getpath.c should not use hardcoded buffer sizes (MAXPATHLEN)

2019-03-18 Thread STINNER Victor


New submission from STINNER Victor :

I'm working on a change to avoid hardcoded buffer sizes (MAXPATHLEN) in 
Modules/getpath.c. This issue is a place holder to discuss it.

--
components: Interpreter Core
messages: 338255
nosy: vstinner
priority: normal
severity: normal
status: open
title: Modules/getpath.c should not use hardcoded buffer sizes (MAXPATHLEN)
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



[issue36352] Modules/getpath.c should not use hardcoded buffer sizes (MAXPATHLEN)

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1be0d1135f5627d0525eab635cf2da441d9cbc08 by Victor Stinner in 
branch 'master':
bpo-36352: Clarify fileutils.h documentation (GH-12406)
https://github.com/python/cpython/commit/1be0d1135f5627d0525eab635cf2da441d9cbc08


--

___
Python tracker 

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



[issue36318] Adding support for setting the "disabled" attribute of loggers from logging.config.dictConfig

2019-03-18 Thread Géry

Géry  added the comment:

> It would be better to set the level of those loggers to e.g. ERROR or 
> CRITICAL rather than disabling them altogether - presumably if something bad 
> happens in those packages, one would want to know!

What if the user doesn't care anyway? Why assuming what the user wants? And 
with solutions 2 and 3, the user can already *completely* silence a specific 
logger from `logging.config.dictConfig`. So it cannot be the reason why the 
`disabled` attribute cannot be set from `logging.config.dictConfig`.

> I don't especially want people to use `disabled` for this type of thing - the 
> main reason for having it is that following an on-the-fly reconfiguration in 
> a long-running process, some threads might still be active that contain 
> references to now-unwanted loggers, and disabling makes those references 
> inactive without the need to track them down.

I think you are referring to the `disable_existing_loggers` key in 
`logging.config.dictConfig`, which sets the `disabled` attribute for loggers 
present in a previous configuration but absent in the new configuration 
(https://github.com/python/cpython/blob/master/Lib/logging/config.py#L161).

So a user can already deactivate *all* existing loggers from 
`logging.config.dictConfig`. What if he wants to deactivate only *one* specific 
logger, but not all (for whatever reason)?

If the `disabled` attribute should not be part of the public API, it should 
have been name `_disabled`. Currently everyone can type this anyway:


import logging

logging.getLogger("foo").disabled = True


So it should be doable from `logging.config.dictConfig` too in my opinion.

--

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Just a question: I think it should be backported to 3.7 and 2.7 (...)

Right, I wrote PRs for that. I didn't use GitHub labels because the bot is 
currently broken.

--

___
Python tracker 

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



[issue36320] typing.NamedTuple to switch from OrderedDict to regular dict

2019-03-18 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Blech. Just remembered _field_types is a *class* attribute, not an instance 
attribute, so it (just) can't be a plain property on NamedTuple itself.

And because NamedTuple is super-weird (AFAICT, class X(typing.NamedTuple): pass 
defines a class where the class is not a subclass of typing.NamedTuple, nor are 
its instances instances of NamedTuple, it's just wrapping an invocation of 
collections.namedtuple, which directly subclasses tuple with no metaclass 
involvement), and making a "class property" of the type we'd need requires a 
metaclass (which for tuple subclasses isn't an option), serious hackery or both 
( https://stackoverflow.com/q/5189699/364696 ), it's probably not worth the 
effort to provide this warning. The only way to do it, AFAICT, would be to give 
the root tuple class a metaclass to provide the _field_types property, and 
that's a non-starter given it would, among other things, probably slow every 
single use of tuples just to provide the warning for this one niche case.

Boo.

--

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12371

___
Python tracker 

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



[issue36351] the ipv6type variable in configure.ac may be set incorrectly when cross-compiling

2019-03-18 Thread Xavier de Gaye


Change by Xavier de Gaye :


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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12369

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 72c7b372cf145fded93a9a776acc742a60090f95 by Victor Stinner in 
branch 'master':
bpo-36235: Enhance distutils test_customize_compiler() (GH-12403)
https://github.com/python/cpython/commit/72c7b372cf145fded93a9a776acc742a60090f95


--

___
Python tracker 

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



[issue36304] When using bz2 and lzma in mode 'wt', the BOM is not written

2019-03-18 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



[issue36328] tstate may be used uninitialized in Py_NewInterpreter

2019-03-18 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 9e06d2b865beb62e54a4da39eb191f9fb8385282 by Victor Stinner 
(Stéphane Wirtel) in branch 'master':
bpo-36328: Fix compiler warning in Py_NewInterpreter() (GH-12381)
https://github.com/python/cpython/commit/9e06d2b865beb62e54a4da39eb191f9fb8385282


--
nosy: +vstinner

___
Python tracker 

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



[issue36351] the ipv6type variable in configure.ac may be set incorrectly when cross-compiling

2019-03-18 Thread Xavier de Gaye


New submission from Xavier de Gaye :

The tests that set the 'ipv6type' variable in configure.ac check the local file 
system and this may give incorrect values when cross-compiling. For example the 
/etc/netconfig file exists on Archlinux, and configure sets ipv6type=solaris 
when cross-compiling Android on this platform.

--
components: Cross-Build
messages: 338250
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: the ipv6type variable in configure.ac may be set incorrectly when 
cross-compiling
type: behavior
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



[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Please don't break the backward compatibility without an easy way to retrieve 
Python 3.7 behavior.

I set the priority to release blocker until a consensus can be found, and I add 
Lukasz (Python 3.8 release manager) in the loop.


Ned Batchelder: "I'm a bit mystified why people are still opposed to providing 
sorting control, even after people are resorting to "hack work-arounds."  The 
(two) pull requests that provide the control are simple, easy to understand, 
and easy to test."

I concur. I'm fine with sorting by default, but it breaks the backward 
compatibility on purpose without providing an option to opt-in for the old 
behavior :-(

Many XML parsers rely on the order of attributes. It's part of the XML 
"semantics". Well, it shouldn't, but I cannot fix all applications around the 
world to explain them that Python is right, and they are all wrong :-)

It's not straighforward to fix an application to get Python 3.7 behavior. I 
would prefer to not have to copy-paste Stefan Behnel's recipe in every project 
using XML who wants to sort attributes:

"""
Something like this:

def sort_attributes(root):
for el in root.iter():
attrib = el.attrib
if len(attrib) > 1:
attribs = sorted(attrib.items())
attrib.clear()
attrib.update(attribs)
"""

This recipe does modify the document and so changes the behavior of the 
application when it iterates on attributes later, whereas in Python 3.7 
attributes are only sorted while writing the XML into a file.

--
nosy: +lukasz.langa
priority: normal -> release blocker

___
Python tracker 

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



[issue36328] tstate may be used uninitialized in Py_NewInterpreter

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Interpreter Core
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



[issue36214] AC_RUN_IFELSE macros not used as arguments of AC_CACHE_VAL et al

2019-03-18 Thread Xavier de Gaye


Change by Xavier de Gaye :


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



[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

in fact, there is no easy way for the fix for python-docutils.

--

___
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-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

I'm ok with modifying "make server" to reuse http.server, but I'm not sure 
about deprecating Tools/scripts/serve.py.

serve.py uses wsgiref which is different than http.server. Does anyone use it? 
I would prefer to keep it. If you want to remove it, please send an email to 
python-dev to ask who uses it.


"make serve" has been added by bpo-8004 which added Tools/scripts/serve.py.

commit e4c74e1ea26e77b065a8999b7192160595474211
Author: Dirkjan Ochtman 
Date:   Wed Feb 24 04:12:11 2010 +

Issue #8004: add a serve target to the Doc Makefile.

--
nosy: +vstinner

___
Python tracker 

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



[issue35605] backported patch requires new sphinx, minimum sphinx version was not bumped

2019-03-18 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +12367

___
Python tracker 

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



[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-18 Thread Paul Moore


Paul Moore  added the comment:

I ran Tools/nuget/build.bat manually, and the resulting file didn't have 
lib\venv in it (I opened it in 7-zip, I don't know how to install a local nuget 
file...).

Could you build the nuget files and check? Or suggest a better way I can check 
that the change has worked?

--

___
Python tracker 

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



[issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> https://buildbot.python.org/all/#/builders/21/builds/2512

It's s390x RHEL 3.x.

--

___
Python tracker 

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



[issue36320] typing.NamedTuple to switch from OrderedDict to regular dict

2019-03-18 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Would it make sense to convert _field_types to a property, so the method(s) 
that implement the property can do:

warnings.warn("_field_types is deprecated; use __annotations__ instead", 
DeprecationWarning)

to indicate the deprecation programmatically, not just in the documentation? 
The property could be backed by __annotations__ directly; they're already 
aliases of one another, so the only difference in behavior would be if someone 
was actually reassigning _field_types after class definition time (which I'm 
hoping is an invalid use case...). Would save some headaches for folks who run 
with warnings enabled, but don't read the What's New notices in detail.

--
nosy: +josh.r

___
Python tracker 

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



[issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Seems it used to fail randomly in past too : issue30648

Well, test_logout() fails randomly every 6 months, but when it fails: we have 
zero info about the bug. The "NO" in the error means that an exception has been 
raised and the server didn't reply to the "LOGOUT" command.

--

___
Python tracker 

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



[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-18 Thread Steve Dower


Steve Dower  added the comment:

The change in the PR should be all that's necessary - the props file you are 
referring to is for end-users to integrate a Python build into their 
application (where I still assume they don't want venvs, and if they do there's 
already a property there to include them).

How do you know your current change isn't working?

--

___
Python tracker 

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



[issue36304] When using bz2 and lzma in mode 'wt', the BOM is not written

2019-03-18 Thread Gianluca


Gianluca  added the comment:

In case the file is not seekable, we could decide based on the file mode:
- if mode='w', write the BOM
- if mode='a', don't write the BOM

Of course, mode "a" doesn't guarantee we are in the middle of the file, but it 
seems a consistent behavior not writing the BOM if we are "appending" to the 
file.

--

___
Python tracker 

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



  1   2   3   >