[issue35692] pathlib.Path.exists() on non-existent drive raises WinError instead of returning False

2019-02-03 Thread Steve Dower


Change by Steve Dower :


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



[issue35706] Make it easier to use a venv with an embedded Python interpreter

2019-02-03 Thread Steve Dower


Steve Dower  added the comment:

Py_Initialize() is not supposed to set it up. If you are embedding Python, you 
have to be responsible for configuring the paths that it uses - pyvenv.cfg is 
configuration for Python interactive, not the shared lib (using Windows 
terminology, it's configuration for python.exe but not python36.dll).

Personally, I am 100% against letting an embedded runtime automatically pick up 
any settings from the environment. You don't know where they came from. That 
said, I'm also in favor of making it easy for embedders to imitate the 
interactive shell's configuration.

Victor (nosied) and others are in the long process of updating embedded 
interpreter configuration to be easier to use, so adding him here as feedback, 
but I don't believe there is going to be a specific fix for this. Consider 
calling Py_SetPath before Py_Initialize to configure the search paths you want 
to use.

--
nosy: +vstinner

___
Python tracker 

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



[issue35692] pathlib.Path.exists() on non-existent drive raises WinError instead of returning False

2019-02-03 Thread miss-islington


miss-islington  added the comment:


New changeset 69af4395a25481e9de4009c816b6d1f032a2d8eb by Miss Islington (bot) 
in branch '3.7':
bpo-35692: pathlib no longer raises when checking file and directory existence 
on drives that are not ready (GH-11746)
https://github.com/python/cpython/commit/69af4395a25481e9de4009c816b6d1f032a2d8eb


--
nosy: +miss-islington

___
Python tracker 

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



[issue35873] Controlling venv from venv no longer works in 3.7.2

2019-02-03 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +11692

___
Python tracker 

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



[issue35872] Creating venv from venv no longer works in 3.7.2

2019-02-03 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +11689, 11690, 11691

___
Python tracker 

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



[issue35872] Creating venv from venv no longer works in 3.7.2

2019-02-03 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +11689

___
Python tracker 

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



[issue35872] Creating venv from venv no longer works in 3.7.2

2019-02-03 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +11689, 11690

___
Python tracker 

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



[issue35873] Controlling venv from venv no longer works in 3.7.2

2019-02-03 Thread Steve Dower


Steve Dower  added the comment:


New changeset a8474d025cab794257d2fd0bea67840779b9351f by Steve Dower in branch 
'master':
bpo-35872 and bpo-35873: Clears __PYVENV_LAUNCHER__ variable (GH-11745)
https://github.com/python/cpython/commit/a8474d025cab794257d2fd0bea67840779b9351f


--

___
Python tracker 

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



[issue35872] Creating venv from venv no longer works in 3.7.2

2019-02-03 Thread Steve Dower


Steve Dower  added the comment:


New changeset a8474d025cab794257d2fd0bea67840779b9351f by Steve Dower in branch 
'master':
bpo-35872 and bpo-35873: Clears __PYVENV_LAUNCHER__ variable (GH-11745)
https://github.com/python/cpython/commit/a8474d025cab794257d2fd0bea67840779b9351f


--

___
Python tracker 

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



[issue35692] pathlib.Path.exists() on non-existent drive raises WinError instead of returning False

2019-02-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11686, 11687

___
Python tracker 

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



[issue35692] pathlib.Path.exists() on non-existent drive raises WinError instead of returning False

2019-02-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11686

___
Python tracker 

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



[issue35692] pathlib.Path.exists() on non-existent drive raises WinError instead of returning False

2019-02-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11686, 11687, 11688

___
Python tracker 

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



[issue35692] pathlib.Path.exists() on non-existent drive raises WinError instead of returning False

2019-02-03 Thread Steve Dower


Steve Dower  added the comment:


New changeset 2f6fae6e510dba653391cb510a2aca8322eec03b by Steve Dower in branch 
'master':
bpo-35692: pathlib no longer raises when checking file and directory existence 
on drives that are not ready (GH-11746)
https://github.com/python/cpython/commit/2f6fae6e510dba653391cb510a2aca8322eec03b


--

___
Python tracker 

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



[issue35894] Apparent regression in 3.8-dev: 'TypeError: required field "type_ignores" missing from Module'

2019-02-03 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

Oh, that's not my code, it's the core of IPython's REPL :-). I just filed a bug 
with them, referencing this one: https://github.com/ipython/ipython/issues/11590

--

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-03 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

David, 

I don't agree with merging at this point.

The lack of documentation makes it hard to ask for more feedback and broader 
testing, because people won't know how to use the library and provide 
constructive feedback (that's why my review comments on GitHub are mostly 
nitpicking).

Furthermore, distributing this as a package on PyPI is much better way to 
solicit further testing and feedback, because then it can be used right now 
instead of having to wait for a release. Releasing on PyPI is feasible for this 
new functionality because it is a standalone library.

It would be better to revert this changeset until it is much closer to finished 
and there has been time for better code review.

BTW. My comment about copyright on the pull request was about the __copyright__ 
attribute of the C extension, that is rarely used in the stdlib and is IMHO 
something to avoid.

--

___
Python tracker 

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



[issue35894] Apparent regression in 3.8-dev: 'TypeError: required field "type_ignores" missing from Module'

2019-02-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, this definitely changed. When we updated typed_ast to Python 3.7 
recently, the mypy project looked into making certain arguments to AST certain 
nodes optional, but the code responsible for those arguments is too weird to 
easily make that work (it's all generated), so we decided to leave it alone.

IMO the AST in general can't be considered a stable API like other stdlib APIs, 
since when the syntax changes, well, the AST changes, and sometimes that means 
that nodes change. For *consumers* of the AST we generally manage to keep 
things backwards compatible, but for producers, there just is no guarantee.

I think the best way forward is for your code to check the Python version and 
if it's >= 3.8, pass an empty list as the second argument to Module().

If you look at the changes to Python.asdl in the PR you found, you'll see what 
other nodes have changed.

--

___
Python tracker 

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



[issue35894] Apparent regression in 3.8-dev: 'TypeError: required field "type_ignores" missing from Module'

2019-02-03 Thread Nathaniel Smith


New submission from Nathaniel Smith :

Travis provides a "3.8-dev" python, which is updated regularly to track cpython 
master. When running our tests on this Python, specifically version

  python: 3.8.0a0 (heads/master:f75d59e, Feb  3 2019, 07:27:24) 

we just started getting tracebacks:

  TypeError Traceback (most recent call last)
  /opt/python/3.8-dev/lib/python3.8/codeop.py in __call__(self, source, 
filename, symbol)
  131 
  132 def __call__(self, source, filename, symbol):
  --> 133 codeob = compile(source, filename, symbol, self.flags, 1)
  134 for feature in _features:
  135 if codeob.co_flags & feature.compiler_flag:
  TypeError: required field "type_ignores" missing from Module

(Full log: https://travis-ci.org/python-trio/trio/jobs/488312057)

Grepping through git diffs for 'type_ignores' suggests that this is probably 
related to bpo-35766.

I haven't dug into this in detail, but it seems to be happening on tests using 
IPython. The lack of further traceback suggests to me that the exception is 
happening inside IPython's guts (it has some hacks to try to figure out which 
parts of the traceback are in user-defined code versus its own internal code, 
and tries to hide the latter when printing tracebacks). The crash is in 
codeop.Compile.__call__, and IPython does create ast.Module objects and pass 
them to codeop.Compile.__call__:

https://github.com/ipython/ipython/blob/512d47340c09d184e20811ca46aaa2f862bcbafe/IPython/core/interactiveshell.py#L3199-L3200

Maybe ast.Module needs to default-initialize the new type_ignores field, or 
compile() needs to be tolerant of it being missing?

--
messages: 334807
nosy: benjamin.peterson, brett.cannon, gvanrossum, njs, yselivanov
priority: normal
severity: normal
status: open
title: Apparent regression in 3.8-dev: 'TypeError: required field 
"type_ignores" missing from Module'
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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-03 Thread Davin Potts


Davin Potts  added the comment:

This work is the result of ~1.5 years of development effort, much of it 
accomplished at the last two core dev sprints.  The code behind it has been 
stable since September 2018 and tested as an independently installable package 
by multiple people.

I was encouraged by Lukasz, Yury, and others to check in this code early, not 
waiting for tests and docs, in order to both solicit more feedback and provide 
for broader testing.  I understand that doing such a thing is not at all a 
novelty.  Thankfully it is doing that -- I hope that feedback remains 
constructive and supportive.

There are some tests to be found in a branch (enh-tests-shmem) of 
github.com/applio/cpython which I think should become more comprehensive before 
inclusion.  Temporarily deferring and not including them as part of the first 
alpha should reduce the complexity of that release.

Regarding the BSD license on the C code being adopted, my conversations with 
Brett and subsequently Van have not raised concerns, far from it -- there is a 
process which is being followed to the letter.  If there are other reasons to 
object to the thoughtful adoption of code licensed like this one, that deserves 
a decoupled and larger discussion first.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think there is also a license problem.  posixshmem.c contains "Copyright 2012 
Philip Semanchuk, 2018-2019 Davin Potts"

Ronald commented "The only other files with a copyright attribute are parser, 
optparse and platform. I'd prefer to avoid adding new copyright attributes to 
stdlib modules."

(turtle.py has a problematic copyright notice in the docstring.)

I think we definitely should not add new copyright notices.

Copyright notices are redundant: all contributors retain copyright in their 
contributions.

Copyright notices are deceptive: 1. since they are rare, they imply that there 
is something special about a particular module and the listed authors; 2. even 
if a module were special, the notice becomes obsolete as soon as anyone else 
contributes to the module.

Copyright notices are not needed: contributors authorize PSF to distribute the 
collective work under a rather liberal license.  If anyone want to make a use 
of Python code not covered by that license, and wants to bypass PSF, they would 
have to look at git log and and git blame to find the relevant contributors.

In this case, part of the work is attributed to Philip Semanchuk as a current 
copyright owner.  According to https://bugs.python.org/user2567, he has not 
signed the contributor agreement, so his work should not have been merged until 
he has.  Even if he had, he would have to specifically agree to his work being 
contributed.  Sorry to be a grinch, but aside from anything else, I think this 
should be reverted until the legal question is clarified.

Some of this might need discussion on pydev.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue35586] Open pyexpat compilation, Make shows error(missing separator)

2019-02-03 Thread Ned Deily


Ned Deily  added the comment:

Sorry about the delay in responding.  I am unable to reproduce the problem but 
I may be missing some important details.  What platform were you attempting to 
build on?  What was the exact path to the source directory?  And, if you can 
still reproduce, could you attach a copy of the generated Makefile and the 
output from running it?

--
nosy: +ned.deily

___
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-02-03 Thread Ned Deily


Ned Deily  added the comment:

I agree that this can go into 3.6. Thanks, everyone!

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



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

2019-02-03 Thread Ned Deily


Ned Deily  added the comment:


New changeset 9bacdce451618a5f0bf62cb1b6f966ebde0492c6 by Ned Deily (Anthony 
Sottile) in branch '3.6':
[3.6] bpo-35605: Fix documentation build for sphinx<1.6 (GH-11368)
https://github.com/python/cpython/commit/9bacdce451618a5f0bf62cb1b6f966ebde0492c6


--

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

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



[issue35893] distutils fails to build extension on windows when it is a package.__init__

2019-02-03 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

FWIW the project in question is modulegraph2 
, which almost 
works on Windows, except for this issue and some incorrect code on my side that 
assumes virtualenv on Windows behaves the same as on POSIX w.r.t. the structure 
of virtual environments.

--

___
Python tracker 

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



[issue35893] distutils fails to build extension on windows when it is a package.__init__

2019-02-03 Thread Ronald Oussoren


New submission from Ronald Oussoren :

Python supports having a C extension for the the __init__ of a package (instead 
of having __init__.py). This works fine on Linux, but on Windows distutils 
fails to build the C extension because it assumes the entry point is named 
PyInit___init__ while importlib expects PyInit_*package* (for a package named 
*package*). 

When building the extension I get the following error:

LINK : error LNK2001: unresolved external symbol PyInit___init__
build\temp.win32-3.7\Release\__init__.cp37-win32.lib : fatal error LNK1120: 1 
unresolved externals


The code below can be used to reproduce the issue.

Setup.py (extracted from a larger setup.py, but should work...):

from setuptools import setup, Extension
extension3 = Extension("ext_package.__init__", sources=["init.c"])

setup(
ext_modules=[extension3],
)

Source code for the module (init.c):

#include "Python.h"
  

static PyModuleDef mod_def = {
PyModuleDef_HEAD_INIT,
"ext_package.__init__",
NULL,
0,
NULL,
NULL,
NULL,
NULL,
NULL
};

PyObject* PyInit_ext_package(void)
{
return PyModule_Create(_def);
}


P.S. I cannot easily debug this, I ran into this when testing one of my 
projects on AppVeyor and don't have a local Windows machine.

--
components: Distutils, Windows
messages: 334800
nosy: dstufft, eric.araujo, paul.moore, ronaldoussoren, steve.dower, 
tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: distutils fails to build extension on windows when it is a 
package.__init__
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-03 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

And to make things clear, I'm not saying anything about the functionality.  
Easier shared memory + multiprocessing is definitely an interesting endeavour 
(and a non-trivial one).

--

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-03 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

FWIW I agree with reverting this pull request, the work is clearly not finished 
yet.

--

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-03 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Yes, I think this was merged too soon.  Davin, the convention is that we only 
merge completed work, not some work-in-progress.

You already did this once in https://bugs.python.org/issue28053 .  You still 
haven't completed that piece of work.

I'm going to ask for this to be reverted.

--
nosy: +pitrou

___
Python tracker 

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



[issue35533] argparse standard error usage for exit / error

2019-02-03 Thread paul j3


Change by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue35706] Make it easier to use a venv with an embedded Python interpreter

2019-02-03 Thread Ned Deily


Change by Ned Deily :


--
components: +Windows
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



[issue35892] Fix awkwardness of statistics.mode() for multimodal datasets

2019-02-03 Thread Raymond Hettinger

New submission from Raymond Hettinger :

The current code for mode() does a good deal of extra work to support its two 
error outcomes (empty input and multimodal input).  That latter case is 
informative but doesn't provide any reasonable way to find just one of those 
modes, where any of the most popular would suffice.  This arises in nearest 
neighbor algorithms for example. I suggest adding an option to the API:

   def mode(seq, *, first_tie=False):   
   if tie_goes_to_first:
   # CHOOSE FIRST x ∈ S | ∄ y ∈ S : x ≠ y ∧ count(y) > count(x)
   return return Counter(seq).most_common(1)[0][0]
   ...

Use it like this:

>>> data = 'ABBAC'
>>> assert mode(data, first_tie=True) == 'A'

With the current API, there is no reasonable way to get to 'A' from 'ABBAC'.

Also, the new code path is much faster than the existing code path because it 
extracts only the 1 most common using min() rather than the n most common which 
has to sort the whole items() list.  New path: O(n).  Existing path: O(n log n).

Note, the current API is somewhat awkward to use.  In general, a user can't 
know in advance that the data only contains a single mode.  Accordingly, every 
call to mode() has to be wrapped in a try-except.  And if the user just wants 
one of those modal values, there is no way to get to it.  See 
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mode.html for 
comparison.

There may be better names for the flag.  "tie_goes_to_first_encountered" seemed 
a bit long though ;-)

--
assignee: steven.daprano
components: Library (Lib)
messages: 334796
nosy: rhettinger, steven.daprano
priority: normal
severity: normal
status: open
title: Fix awkwardness of statistics.mode() for multimodal datasets
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



[issue12374] Execution model should explain compile vs definition vs execution time

2019-02-03 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Hi Nick,

Would you be able to update the link as 
http://svn.python.org/view/sandbox/trunk/userref/ODF/ isn't valid anymore?  
Have things changed even more since you created this issue or are you still 
interested in pursuing this?  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



[issue27485] urllib.splitport -- is it official or not?

2019-02-03 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Please refer to issue35891 for a description of an important use-case broken by 
the planned removal of splituser.

--
nosy: +jason.coombs

___
Python tracker 

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



[issue35891] urllib.parse.splituser has no suitable replacement

2019-02-03 Thread Jason R. Coombs


New submission from Jason R. Coombs :

The removal of splituser (issue27485) has the undesirable effect of leaving the 
programmer without a suitable alternative. The deprecation warning states to 
use `urlparse` instead, but `urlparse` doesn't provide the access to the 
`credential` or `address` components of a URL.

Consider for example:

>>> import urllib.parse
>>> url = 'https://user:password@host:port/path'
>>> parsed = urllib.parse.urlparse(url)
>>> urllib.parse.splituser(parsed.netloc)
('user:password', 'host:port')

It's not readily obvious how one might get those two values, the credential and 
the address, from `parsed`. Sure, you can get `username` and `password`. You 
can get `hostname` and `port`. But if what you want is to remove the credential 
and keep the address, or extract the credential and pass it unchanged as a 
single string to something like an `_encode_auth` handler, that's no longer 
possible without some careful handling--because of possible None values, 
re-assembling a username/password into a colon-separated string is more 
complicated than simply doing a ':'.join.

This recommendation and limitation led to issues in production code and 
ultimately the inline adoption of the deprecated function, [summarized 
here](https://github.com/pypa/setuptools/pull/1670).

I believe if splituser is to be deprecated, the netloc should provide a 
suitable alternative - namely that a `urlparse` result should supply `address` 
and `userinfo`. Such functionality would make it easier to transition code that 
currently relies on splituser for more than to parse out the username and 
password.

Even better would be for the urlparse result to support `_replace` operations 
on these attributes... so that one wouldn't have to construct a netloc just to 
construct a URL that replaces only some portion of the netloc, so one could do 
something like:

>>> parsed = urllib.parse.urlparse(url)
>>> without_userinfo = parsed._replace(userinfo=None).geturl()
>>> alt_port = parsed._replace(port=443).geturl()

I realize that because of the nesting of abstractions (namedtuple for the main 
parts), that maybe this technique doesn't extend nicely, so maybe the netloc 
itself should provide this extensibility for a usage something like this:

>>> parsed = urllib.parse.urlparse(url)
>>> without_userinfo = 
>>> parsed._replace(netloc=parsed.netloc._replace(userinfo=None)).geturl()
>>> alt_port = parsed._replace(netloc=parsed.netloc._replace(port=443)).geturl()


It's not as elegant, but likely simpler to implement, with netloc being 
extended with a _replace method to support replacing segments of itself (and 
still immutable)... and is dramatically less error-prone than the status quo 
without splituser.

In any case, I don't think it's suitable to leave it to the programmer to have 
to muddle around with their own URL parsing logic. urllib.parse should provide 
some help here.

--
components: Library (Lib)
messages: 334793
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: urllib.parse.splituser has no suitable replacement
type: behavior

___
Python tracker 

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



[issue35891] urllib.parse.splituser has no suitable replacement

2019-02-03 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue35706] Make it easier to use a venv with an embedded Python interpreter

2019-02-03 Thread PyScripter


PyScripter  added the comment:

I don't see how pep-0582 is related to embedded python.

The solution is to check for the presence of pyvenv.cfg in PYTHONHOME and set 
up the system.path accordingly.

--

___
Python tracker 

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



[issue35851] Make search result in online docs keep their position when search finishes

2019-02-03 Thread Julien Palard


Julien Palard  added the comment:

Hi Roel,

I like the idea, but as xtreak told, it's a sphinx issue we cannot easy fix on 
our side, better fix it sphinx side. Would you please repoen it on the sphinx 
bug tracker at https://github.com/sphinx-doc/sphinx/issues?

--

___
Python tracker 

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



[issue35706] Make it easier to use a venv with an embedded Python interpreter

2019-02-03 Thread Wolfgang Langner


Wolfgang Langner  added the comment:

I think this pep is related to the issue and could be a solution:
https://www.python.org/dev/peps/pep-0582/

--
nosy: +tds333

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-03 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Was this merged too soon? This is new functionality without any docs and tests. 

I've also left review comments on the pull request.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue32627] Header dependent _uuid build failure on Fedora 27

2019-02-03 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch
pull_requests: +11682, 11683
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



[issue32627] Header dependent _uuid build failure on Fedora 27

2019-02-03 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch
pull_requests: +11682, 11683, 11684
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



[issue32627] Header dependent _uuid build failure on Fedora 27

2019-02-03 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch, patch
pull_requests: +11682, 11683, 11684, 11685
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



[issue32627] Header dependent _uuid build failure on Fedora 27

2019-02-03 Thread Roundup Robot


Change by Roundup Robot :


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