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

2018-12-02 Thread Chris Withers


Chris Withers  added the comment:


New changeset c667b094ae37799a7e42ba5cd2ad501cc7920888 by Chris Withers 
(Xtreak) in branch 'master':
bpo-32153: Add unit test for create_autospec with partial function returned in 
getattr (#10398)
https://github.com/python/cpython/commit/c667b094ae37799a7e42ba5cd2ad501cc7920888


--
nosy: +cjw296

___
Python tracker 

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



[issue35381] Heap-allocated posixmodule types

2018-12-02 Thread Eddie Elizondo


Change by Eddie Elizondo :


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

___
Python tracker 

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



[issue35381] Heap-allocated posixmodule types

2018-12-02 Thread Eddie Elizondo


Change by Eddie Elizondo :


--
title: Heap-allocated Posixmodule types -> Heap-allocated posixmodule types

___
Python tracker 

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



[issue35381] Heap-allocated Posixmodule types

2018-12-02 Thread Eddie Elizondo


Change by Eddie Elizondo :


--
title: Heap-allocated Posixmodule -> Heap-allocated Posixmodule types

___
Python tracker 

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



[issue35381] Heap-allocated Posixmodule

2018-12-02 Thread Eddie Elizondo


New submission from Eddie Elizondo :

After bpo34784, there are still two more cases of statically allocated types 
(DirEntryType & ScandirIteratorType). These should also be heap allocated to 
make posixmodule fully compatible with PEP384.

--
components: Library (Lib)
messages: 330906
nosy: eelizondo
priority: normal
severity: normal
status: open
title: Heap-allocated Posixmodule
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



[issue10320] printf %qd is nonstandard

2018-12-02 Thread Zackery Spytz


Zackery Spytz  added the comment:

I've created a PR for this issue.

--
nosy: +ZackerySpytz
versions: +Python 3.6, 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



[issue10320] printf %qd is nonstandard

2018-12-02 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue35377] urlsplit scheme argument broken

2018-12-02 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

I don't think this is broken, but I do think it could be documented better. You 
have to read the documentation for `urlparse` to see this:

[Quote]
Following the syntax specifications in RFC 1808, urlparse recognizes a netloc 
only if it is properly introduced by ‘//’. Otherwise the input is presumed to 
be a relative URL and thus to start with a path component.

https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse

so the function is correct. You're making two errors:

- providing a relative URL "httpbin.org" and expecting it to be treated as an 
absolute URL;

- specifying scheme+delimiter instead of the scheme alone.

So I don't think this is a bug. urlsplit rightly accepts any arbitrary string 
as a scheme (it used to have a whitelist of permitted schemes, and that was a 
problem), and we can't assume that :/// is ONLY valid for file protocols.

Unless you come up with a convincing argument for why this is a bug, I'm going 
to change it to a documentation issue. The docs could do with some improvement 
to make it more clear, although the examples are good.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue35380] Enable TCP_NODELAY for proactor event loop

2018-12-02 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
assignee:  -> asvetlov

___
Python tracker 

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



[issue35380] Enable TCP_NODELAY for proactor event loop

2018-12-02 Thread Andrew Svetlov


New submission from Andrew Svetlov :

We do it for selector based loops already, let's be consistent.

I think the feature should be backported to 3.7 too.

--
components: asyncio
messages: 330903
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Enable TCP_NODELAY for proactor event loop
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2018-12-02 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Ping.

--

___
Python tracker 

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



[issue30410] Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+

2018-12-02 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I updated the PR with the new wording by Paul, since I found it easier to 
understand as well.

--

___
Python tracker 

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



[issue35366] Monkey Patching class derived from ctypes.Union doesn't work

2018-12-02 Thread Vijay


Vijay  added the comment:

Wanted to post a possible workaround until this is fixed. One can simply wrap a 
union anonymously inside a structure. Like so:

struct my_struct_s {
  union my_union_u {

  };
};

This temporarily solved the problem in my case.

--

___
Python tracker 

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



[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think the code is almost ok (I also prefer to also use the cache as an excuse 
to maintain the pool alive) but the test needs to be done a bit more carefully 
to avoid hanging the test suite in case of failure and to avoid leaking threads 
or processes.

--

___
Python tracker 

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



[issue34238] When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't work

2018-12-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> However, I think there might be a bug with the implementation that doesn't 
> correctly respect the BROWSER preference. Notice how the webbrowser._tryorder 
> has two 'lynx' items and both of them
are last. If you look at the comment in the code, it says that it should be 
prepended to _tryorder because it's the preferred browser

@ograycode Is this similar to issue35308 ?

--
nosy: +xtreak

___
Python tracker 

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



[issue35335] msgfmt should be able to merge more than one po file

2018-12-02 Thread s-ball


s-ball  added the comment:

After some more thinking about it, my opinion is that the proposed path for 
issue 9741 does not address at all my requirements. So I will try to propose a 
pull request addressing both issues here.

--

___
Python tracker 

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



[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread tzickel


tzickel  added the comment:

I dont mind, I think my code is ready for review, but I'm not versed in this, 
so if you think you have something better, feel free to open a PR or tell me if 
I should submit mine, and you can comment on it:

https://github.com/python/cpython/compare/master...tzickel:fix34172

--

___
Python tracker 

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



[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I was working already on a PR. Do you prefer to wait for yours instead?

--

___
Python tracker 

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



[issue35379] IDLE's close fails when io.filename set to None

2018-12-02 Thread Raymond Hettinger


New submission from Raymond Hettinger :

I'm not sure that sequence of events that causes this, but more than once I've 
gotten the following traceback.

Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py",
 line 1705, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/multicall.py",
 line 176, in handler
r = l[i](event)
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/filelist.py",
 line 54, in close_all_callback
reply = edit.close()
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/editor.py",
 line 1017, in close
self._close()
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/pyshell.py",
 line 309, in _close
EditorWindow._close(self)
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/idlelib/editor.py",
 line 1021, in _close
if self.io.filename:
AttributeError: 'NoneType' object has no attribute 'filename'

--
assignee: terry.reedy
components: IDLE
messages: 330894
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE's close fails when io.filename set to None
versions: Python 3.7

___
Python tracker 

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



[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Eric N. Vander Weele


Change by Eric N. Vander Weele :


--
nosy: +ericvw

___
Python tracker 

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



[issue35369] List sorting makes duplicate comparisons

2018-12-02 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> wont fix
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



[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread tzickel


tzickel  added the comment:

It's important to note that before those PR, that code would leak the Pool 
instance until the process ends (once per call).

https://github.com/python/cpython/compare/master...tzickel:fix34172

Is my proposed fix (till I get it to a PR).

--

___
Python tracker 

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



[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-12-02 Thread Prabakaran Kumaresshan


Prabakaran Kumaresshan  added the comment:

It's a side effect of a date arithmetic operation performed while setting 
timezone.

while passing tz info to datetime invokes tz.fromutc() -> 
https://github.com/python/cpython/blob/3df85404d4bf420db3362eeae1345f2cad948a71/Lib/datetime.py#L1593

followed by a datetime arithmetic here -> 
https://github.com/python/cpython/blob/3df85404d4bf420db3362eeae1345f2cad948a71/Lib/datetime.py#L2188

which eventually leads to building a new datetime object here ->
https://github.com/python/cpython/blob/3df85404d4bf420db3362eeae1345f2cad948a71/Lib/datetime.py#L1997-L2000

I'm not sure if its an expected behaviour

--
nosy: +nixphix

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-12-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

As this issue was somehow still present previous to this commit, I am going to 
track this problem in a new issue:

issue35378

--
status: open -> closed

___
Python tracker 

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



[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

After applying the PRs in issue34172, multiprocessing.Pool.imap hangs on MacOs 
and Linux. This is a simple reproducer:

import multiprocessing

def the_test():
print("Begin")
for x in multiprocessing.Pool().imap(int,
["4", "3"]):
print(x)
print("End")

the_test()

This happens because the IMapIterator does not maintain alive the 
multiprocessing.Pool object while it is still alive.

--
components: Library (Lib)
messages: 330890
nosy: pablogsal, pitrou, tzickel
priority: normal
severity: normal
status: open
title: multiprocessing.Pool.imaps iterators do not maintain alive the 
multiprocessing.Pool objects
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


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



[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread miss-islington


miss-islington  added the comment:


New changeset 6cb0486ce861903448bd6ba1095685b6cd48e3bd by Miss Islington (bot) 
in branch '3.7':
bpo-35341: Add generic version of OrderedDict to typing (GH-10850)
https://github.com/python/cpython/commit/6cb0486ce861903448bd6ba1095685b6cd48e3bd


--
nosy: +miss-islington

___
Python tracker 

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



[issue35377] urlsplit scheme argument broken

2018-12-02 Thread devkral


devkral  added the comment:

first a correction; there is one protocol where it make sense:
file
I would change:
...
elif scheme:
...
to
...
elif scheme and scheme != "file":
...


Second: no it is not a correct behaviour. Urlunsplit is supposed to create a 
valid url from a tuple created by urlsplit. :/// is not a valid url (except for 
the file protocol).

Third: rstrip could be simplified to rstrip(":/")

--

___
Python tracker 

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



[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10086

___
Python tracker 

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



[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset 68b56d02ef20479b87c65e523cf3dec1b7b77d40 by Ivan Levkivskyi (Ismo 
Toijala) in branch 'master':
bpo-35341: Add generic version of OrderedDict to typing (GH-10850)
https://github.com/python/cpython/commit/68b56d02ef20479b87c65e523cf3dec1b7b77d40


--

___
Python tracker 

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



[issue35376] modulefinder skips nested modules with same name as top-level bad module

2018-12-02 Thread SilentGhost


Change by SilentGhost :


--
nosy: +brett.cannon, eric.snow, ncoghlan
stage:  -> patch review
versions:  -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



[issue35377] urlsplit scheme argument broken

2018-12-02 Thread SilentGhost


SilentGhost  added the comment:

While it might seem broken, it behaves according to documentation, it seems to 
me.

--
nosy: +SilentGhost, orsenthil
type:  -> behavior

___
Python tracker 

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



[issue34238] When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't work

2018-12-02 Thread Farhaan Bukhsh


Farhaan Bukhsh  added the comment:

Hey I would like to take this bug and work on it, can you please anyone guide 
me how do I proceed?

--
nosy: +fhackdroid

___
Python tracker 

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



[issue35377] urlsplit scheme argument broken

2018-12-02 Thread devkral


New submission from devkral :

the scheme argument of urlsplit/urlparse is completely broken.
here two examples:

urlunsplit(urlsplit("httpbin.org", scheme="https://;))
'https://:httpbin.org'

urlunsplit(urlsplit("httpbin.org", scheme="https"))
'https:///httpbin.org'

Fix: change urlsplit logic like this:
...
url, scheme, _coerce_result = _coerce_args(url, scheme)
scheme = scheme.rstrip("://") # this removes ://
...
i = url.find('://') # harden against arbitrary :
if i > 0:
...
elif scheme:
netloc, url = _splitnetloc(url, 0)  # if scheme is specified, netloc is 
implied

sry too lazy to create a patch from this. Most probably are all python versions 
affected but I checked only 2.7 and 3.7 .

--
components: Library (Lib)
messages: 330884
nosy: devkral
priority: normal
severity: normal
status: open
title: urlsplit scheme argument broken
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue35376] modulefinder skips nested modules with same name as top-level bad module

2018-12-02 Thread rdb


New submission from rdb :

If modulefinder finds a nested module import (eg. 'import a.b.c') while there 
is a top-level module with the same name (eg. 'c') that failed to import and 
got added to the badmodules list, it will skip it entirely without even trying 
to import it.

This has a trivial fix (attached).  The right thing to do is clearly to check 
it by fqname in the badmodules dict since that's also what it expects in other 
locations.

I can make a PR as soon as my CLA gets validated, if that is more convenient.  
(Which branch should I make the PR against?)

--
components: Library (Lib)
files: patch.diff
keywords: patch
messages: 330883
nosy: rdb
priority: normal
severity: normal
status: open
title: modulefinder skips nested modules with same name as top-level bad module
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47968/patch.diff

___
Python tracker 

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



[issue35226] mock.call equality surprisingly broken

2018-12-02 Thread Daniel Fortunov


Change by Daniel Fortunov :


--
nosy: +dfortunov

___
Python tracker 

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



[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread Sriram Krishna


Sriram Krishna  added the comment:

Already covered in issue29929: https://bugs.python.org/issue29929.

Thanks xtreak for the link to the message thread.

PEP 432 seems to have methods to resolve this.

Currently if the code doesn't access to .local, one can use the -I commandline 
option and use from . import module for local imports.

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2018-12-02 Thread Eryk Sun


Change by Eryk Sun :


--
nosy: +eryksun

___
Python tracker 

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



[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Martin Panter

Martin Panter  added the comment:

Yeah, the TarFile class would fix up the header when the user calls “close”. I 
think this is how it was done for ZipFile (implemented in Issue 26039).

Yes currently you would have to build the tarinfo object by hand. I think a 
helper function would be nice, but the “TarFile.gettarinfo” method is not a 
good place for that. In fact, documenting the default settings for the TarInfo 
constructor may be enough. Then you might get away with the following if you 
just want a regular file with no specific attributes:

download_tarinfo = TarInfo('index.html')
svgz_tarinfo = TarInfo('image.svg.gz')

--

___
Python tracker 

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



[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread Sriram Krishna


Sriram Krishna  added the comment:

My contention is that this behaviour breaks the Principle of Least Astonishment.

In the particular example I gave, the user doesn't know (and can't be expected 
to know) the existence of a module called profile in the standard library. Here 
the user is not explicitly importing profile. The user can't be expected to 
know which submodules are imported by the modules they use. Hence they wouldn't 
expect another file sitting in the same directory to get imported when they are 
not explicitly importing it.

on 2018-12-02 10:35, pmpp said:
> you can avoid that with

> import sys,os
> sys.path.remove( os.getcwd() )

> at the start of your program. 

completely removing cwd from sys.path would disable the option of importing 
user modules.

Any method of fixing this would be backwards incompatible, and will break some 
(most likely badly written) code.

My hack solution was to have cwd in sys.path only if __name__ is '__main__'.

--

___
Python tracker 

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



[issue29541] Python3 error while building on Alt-F

2018-12-02 Thread Martin Panter

Martin Panter  added the comment:

The missing “crypt” symbol is probably this function: 
. It is 
defined by the OS or a separate library, not by Python. You may need to link 
the “_crypt” Python module to the library that contains the function. E.g. in 
Glibc  you are meant to 
“link with -lcrypt”, although I suspect Python’s “setup.py” normally does that 
automatically.

--
nosy: +martin.panter

___
Python tracker 

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



[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Thanks, this looks interesting.

How will the file writer know the whole file has been read? The override of the 
Tar header is done on `close`?

Are `download_tarinfo` and `svgz_tarinfo` built by hand if we don't make 
changes in `gettarinfo`?

--

___
Python tracker 

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



[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> A python user can't be expected to know the name of every possible file in 
> the Python standard library. Maybe the current working directory should be 
> removed from sys.path when importing from within another module not in the 
> same directory.

I think there was a similar discussion about this since Perl did a related 
change : https://mail.python.org/pipermail/python-ideas/2017-June/045842.html

--
nosy: +xtreak

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2018-12-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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



[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread pmpp


pmpp  added the comment:

hi you are obsverving that because current working directory is set *first* in 
sys.path as a commodity

you can avoid that with

import sys,os
sys.path.remove( os.getcwd() )

at the start of your program. 

otherwise usually it is wise to put user module in a package and choose its 
name with care.

--
nosy: +pmpp

___
Python tracker 

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



[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> Shall I open a new issue for this?

@itoijala Please see https://bugs.python.org/issue33462. It's on master.

--
nosy: +xtreak

___
Python tracker 

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



[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ismo Toijala


Change by Ismo Toijala :


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

___
Python tracker 

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



[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread Sriram Krishna


New submission from Sriram Krishna :

Suppose I have a file profile.py in the same directory as the file I am running 
(say test.py)

Let the contents of the files be:

profile.py:
raise Exception

test.py:
import cProfile

now if I run test.py

$ python test.py
Traceback (most recent call last):
  File "test.py", line 1, in 
import cProfile
  File "/usr/lib/python3.7/cProfile.py", line 10, in 
import profile as _pyprofile
  File "/home/username/profile.py", line 1, in 
raise Exception
Exception

The file profile.py in '/usr/lib/python3.7' should have been loaded. This would 
also happen if test.py imported a module or package which imported cProfile.

The only possible way of avoiding this problem completely is by ensuring that 
the name of any the python files don't match a builtin python file or the name 
of any installed package.

A python user can't be expected to know the name of every possible file in the 
Python standard library. Maybe the current working directory should be removed 
from sys.path when importing from within another module not in the same 
directory.

--
components: Interpreter Core
messages: 330874
nosy: ksriram
priority: normal
severity: normal
status: open
title: name shadowing while a module tries to import another
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ismo Toijala


Ismo Toijala  added the comment:

My reason for using OrderedDict was that the normal dict is not reversible. I 
needed to get the last element added, so I ended up doing something like 
next(reversed(ordered_dict)).

Perhaps this would be something to add to the normal dict (for 3.8?). Then I 
could migrate away from OrderedDict.

Shall I open a new issue for this?

--

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2018-12-02 Thread Christian Ullrich


Change by Christian Ullrich :


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

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2018-12-02 Thread Christian Ullrich


New submission from Christian Ullrich :

If hhc.exe is on the PATH when HTML Help is being built, the build fails 
because make.bat does not correctly remember the fact. The set command is very 
finicky with trailing spaces, leading to this:

'"hhc "' is not recognized as an internal or external command,
operable program or batch file.

I suppose the "official" build does not rely on autodetection. In that case, a 
better fix would be to require setting HTMLHELP explicitly.

PR (for the single-character fix) incoming.

--
assignee: docs@python
components: Documentation
messages: 330872
nosy: chrullrich, docs@python
priority: normal
severity: normal
status: open
title: Windows doc build does not find autodetected hhc.exe
type: compile error

___
Python tracker 

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



[issue35228] Index search in CHM help crashes viewer

2018-12-02 Thread Christian Ullrich


Christian Ullrich  added the comment:

Ma Lin, thanks for the suggestion!

Yes, it looks like this option fixes the problem. I can reproduce the crash at 
will with a .chm built without this option, and not at all with one that has it 
on.

If the .chm's directory is not writable, the .chw will be created, and later 
reused from, %APPDATA%\Microsoft\HTML Help.

Unfortunately, sphinx apparently has no facility for setting this option to Yes 
in the generated .hhp file, so it will have to be modified before compilation.

--

___
Python tracker 

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



[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Martin Panter

Martin Panter  added the comment:

If something like your “addbuffer” method existed, then you won’t need to get 
the size first, right? We don’t need the changes in “gettarinfo” for 
“addbuffer” to be useful.

BTW have you considered returning a file writer rather than accepting a file 
reader? Similar to ZipFile.open(..., mode='w'). It would be a bit more 
complicated to implement, but also more flexible for the user:

# File downloaded with “urlopen”, also possible with TarFile.addbuffer API:
with tf.get_file_writer(download_tarinfo) as writer:
shutil.copyfileobj(urlopen_response, writer)

# SVG file generated on the fly, encoded with UTF-8 and Gzip compressed; not 
possible with “addbuffer”:
writer = tf.get_file_writer(svgz_tarinfo)
gzip_writer = gzip.GzipFile(fileobj=writer, mode='w')
with io.TextIOWrapper(gzip_writer, 'utf-8') as text_writer:
svg = xml.sax.saxutils.XMLGenerator(text_writer, 'UTF-8')
svg.startDocument()
...

--

___
Python tracker 

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