[issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__

2018-11-19 Thread INADA Naoki


INADA Naoki  added the comment:

I worried about people think we recommend it when we support it, while this is 
just a request from one person, not recommendation after wide discussion.

But it doesn't affect to static tools than I suspected. Tools like 
autocompletion should support  cached_property in normal class anyway.

And this pull request doesn't promote the cached_property support in the 
document.
So I don't have a strong objections for now.


Generally speaking, I don't like this type of changes.
Some people think it's improvement, but since there are no clear 
vision/recommendation how ABCs are used, it's just a random increasing code.
We can't maintain "preferably only one obvious way" for now, especially about 
ABCs.

--

___
Python tracker 

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



[issue31601] Availability of utimensat, futimens not checked correctly on macOS

2018-11-19 Thread Peter Petrik


Peter Petrik  added the comment:

This issue blocks QGIS distribution on MacOS for 10.11 and 10.12 releases, 
https://github.com/lutraconsulting/qgis-mac-packager/issues/22

I would like to know how much work is involved to fix the issue, possible 
whether there is a plan to fix it. Also we would appreciate quote & timeline 
for fix to i...@lutraconsulting.co.uk, so we can consider to sponsor this fix. 
Thanks

--
nosy: +Peter Petrik2

___
Python tracker 

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



[issue35273] 'eval' in generator expression behave different in dict from list

2018-11-19 Thread Windson Yang


Windson Yang  added the comment:

I get NameError for both versions in both 3.4.4, 3.5.2, 3.6.4, 3.7.1

--
nosy: +Windson Yang

___
Python tracker 

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



[issue35251] FTPHandler.ftp_open documentation error

2018-11-19 Thread Windson Yang


Change by Windson Yang :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

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



[issue35271] venv creates pyvenv.cfg with wrong home

2018-11-19 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 

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



[issue35200] Make the half-open range behaviour easier to teach

2018-11-19 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Raymond:
> I'm in agreement with the comments that the proposed __str__ revision is 
> confusing.

In what way is it "confusing"?

I'm especially perplexed that Julien apparently thinks it is confusing when 
emitted by str(), but educational and useful when emitted by repr(). This makes 
no sense to me.

I think Julien's idea is a good one, just not for repr, and I don't think it is 
confusing at all.


Raymond:
> most other iterators can't show a preview of the output without actually 
> consuming some of their inputs

`range` is not some arbitrary iterator, in fact it isn't an iterator at all:

py> r = range(10)
py> iter(r) is r
False


It is a sequence, like list and tuple, and like list and tuple it is perfectly 
capable of showing its content (in full or part) on demand. Other important 
built-in sequence types like strings, lists and tuples aren't hamstrung with 
the restriction not to do anything iterators can't do, there's no good reason 
for range objects to be given that restriction.


Julien:
> I'm closing this.

Not so hasty, please. Some of us think this is a worthwhile enhancement. You 
might have changed your mind, but the idea is bigger than you now :-)

I'm taking this discussion to Python-Ideas to see if there is community 
interest in this feature. If so, I'm going to reopen the issue.

--

___
Python tracker 

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



[issue35251] FTPHandler.ftp_open documentation error

2018-11-19 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Yeah, I am not currently working on this, so feel free to make a PR anytime you 
want.

--

___
Python tracker 

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



[issue22121] IDLE should start with HOME as the initial working directory

2018-11-19 Thread Steve Dower


Steve Dower  added the comment:

AFAICT, the best logic is this:

if os.path.normcase(os.getcwd()) == os.path.normcase(sys.prefix):
os.chdir(get_default_location(sys.platform))

The only complexity is likely to be that "Documents" is localized on Windows, 
and SHGetFolderPathW [1] requires ctypes, though I wouldn't be surprised if 
there's a hidden English link available. There might be some trick necessary 
for macOS too. All the command line options will work for now, but will break 
in the future.

[1]: 
https://docs.microsoft.com/en-us/windows/desktop/api/shlobj_core/nf-shlobj_core-shgetfolderpathw

It's not real obvious, but when https://bugs.python.org/issue34977 lands - 
soon! - we'll get good PATH support back, including for Idle. This means you'll 
get "idle[3[.y]].exe" available globally that will do the same thing as the 
icon in Start. In this situation, the logic above is the _only_ option that 
will work properly, as there are no arguments we can pass. So forcing the CWD 
out of the install directory but otherwise leaving it alone is the best option.

--

___
Python tracker 

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



[issue35276] Document thread safety

2018-11-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

One idea is that you could author a threading HOWTO document that covers 
atomicity, locks, queues, reentrancy, etc.  This is a thorny topic and it would 
be nice to have the principles and techniques collected in one place.

Ideally, it would include examples of what to expect in various situations.  
For example, the pure python OrderedDict can be put in an inconsistent state if 
two threads make updates without a mutex; however, the containers implemented 
in C can never be broken even if they don't guarantee atomicity (i.e. a dict 
update making a pure python callback to __hash__ will never result in a broken 
dict).

ISTM that the docs have presumed that people using threading know what they're 
doing; however, we know that isn't always true ;-)

--

___
Python tracker 

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



[issue35221] Enhance venv activate commands readability

2018-11-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Lisa that this is something the people need to learn (that is why 
they're taking a class).  

FWIW, I've seen people copy square brackets for optional arguments, 
"mypow(base[, exp])" and angle brackets for syntax, " if  
else ".  We also see it with the ellipsis.

Accordingly, there should be a FAQ entry or tutorial section on meta-syntactic 
variable and syntax placeholders.   The would also be a good place to cover the 
confusing "/" and "*" notations generated by the argument clinic:  
__getattribute__(self, name, /).

FWIW, if your students are also cutting-and-pasting the prompt, this is clearly 
an education issue and not an issue with the venv docs.

--
nosy: +rhettinger

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2018-11-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Regarding other uses of .pth files, the project 
[future-fstrings](https://github.com/asottile/future-fstrings) relies on .pth 
files to enable its at-startup behavior.

I'm also +1 to remove .pth files, but I also believe it's not viable today due 
to development installs of pkg_resource-style namespace packages.

I haven't read the full history of this issue, but plan to get caught up on it 
soon.

--
nosy: +jason.coombs

___
Python tracker 

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



[issue35221] Enhance venv activate commands readability

2018-11-19 Thread Julien Palard


Change by Julien Palard :


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

___
Python tracker 

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



[issue28401] Don't support the PEP384 stable ABI in pydebug builds

2018-11-19 Thread Brett Cannon


Change by Brett Cannon :


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



[issue35200] Make the half-open range behaviour easier to teach

2018-11-19 Thread Julien Palard


Julien Palard  added the comment:

Hi Raymond,

I agree, there exist other means of teaching half closed range, but I was more 
concerned by self-taught students, alone facing the current range repr than 
students well accompanied.

I also agree, let's not change the current repr (for backward compatibility) 
and let's not change the current str (it won't help anyway), so I'm closing 
this.

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



[issue35131] Cannot access to customized paths within .pth file

2018-11-19 Thread Brett Cannon


Brett Cannon  added the comment:

There is not "find best encoding" code, hence why so much code out there uses 
chardet. :)

This might also tie into issue #33944 and the idea of rethinking .pth files.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue35200] Make the half-open range behaviour easier to teach

2018-11-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

After more thought, I'm in agreement with the comments that the proposed 
__str__ revision is confusing.

After teaching another Python intro course last week, I'm now thinking that no 
change should be made.  There are other effective ways to teach half-open 
intervals (i.e. using slicing on strings is now my preferred way). 

Also students need to learn about using list() with iterators.  This core skill 
comes up with generators, enumerate, zip, filter, etc. So, we just need to 
teach the skill earlier in the course than we did with Python2.7.

I recommend that we just close this and resist the urge to create a new oddity 
that does't generalize well (i.e. most other iterators can't show a preview of 
the output without actually consuming some of their inputs).

--

___
Python tracker 

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



[issue35281] Allow access to unittest.TestSuite tests

2018-11-19 Thread Lihu


Change by Lihu :


--
nosy: +ezio.melotti, michael.foord, rbcollins

___
Python tracker 

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



[issue35281] Allow access to unittest.TestSuite tests

2018-11-19 Thread Lihu


New submission from Lihu :

I would like to have access to the list of tests in a TestSuite object.
Currently there are two ways of doing this: I can access the protected 
attribute `_tests`, or I can iterate over the TestSuite and re-create data that 
I already have. The former option isn't part of the public API and makes mypy 
mad, and the latter seems redundant. Could we get a public property or getter 
for the internal test list (or a more appropriate implementation if necessary)?

--
components: Library (Lib)
messages: 330111
nosy: lbenezriravin
priority: normal
severity: normal
status: open
title: Allow access to unittest.TestSuite tests
type: enhancement
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



[issue35276] Document thread safety

2018-11-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The general rule in Python is that nothing can be considered atomic unless 
specifically documented as atomic (such as the queue module or lru_cache which 
have internal locks).  The only safe action is to put locks around all accesses 
to shared resources.  We should have a FAQ entry to that effect.  It should 
also note that "thread-safe" means different things to different people.

--
nosy: +rhettinger

___
Python tracker 

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



[issue18859] README.valgrind should mention --with-valgrind

2018-11-19 Thread Sanyam Khurana


Sanyam Khurana  added the comment:

Patch added in PR: https://github.com/python/cpython/pull/10591

--
nosy: +CuriousLearner

___
Python tracker 

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



[issue22121] IDLE should start with HOME as the initial working directory

2018-11-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

ISTM, the start directory needs to be a configuration option.  The problem is 
that most users start IDLE using an icon rather than from the command-line (the 
latter is already challenging on Windows because they would have to put Python 
on the PATH just to launch IDLE and if they've already found and changed to the 
executable directly, it is a unfair further burden to now have to specify a 
different directory where their py files will be parked).

--
nosy: +rhettinger

___
Python tracker 

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



[issue22121] IDLE should start with HOME as the initial working directory

2018-11-19 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Eryk: If one wants a shortcut on the desktop, I believe the one in a directory 
has to be copied.  I was also trying to cover the case where IDLE is installed 
for all users and a particular user wants a customized shortcut.

Steve: Microsoft's effort to keep most users ignorant of command lines has been 
all too successful.  So a new C.L. option can only be part of a solution.

It seems that IDLE automatically changing directory, under some circumstances 
on some systems, to ???, should be part of a solution.
But Documents is better that HOME.  (This is the default now on Mac.)

Last week there was a discussion of this issue started by someone who teaches 
or supports Python for non-computer experts at a university with multiple 
computers around the campus networked to a central computer with installed 
Python.  What he and others want is for IDLE to start in a particular user's 
Python scripts subdirectory, and not have to change the directory in the open 
file dialog. This will require a new config option.  

For a config option to work with repository python (at least for me), I would 
like python.bat to the repository directory that contains /Lib rather than 
merely set PYTHONHOME to same.

I need to make a list a ways to start Python and the consequences for sys.path 
and current directory on the three major systems and add it to 
idlelib/README.txt.  For this issue, there are also ways to open a file after 
IDLE is started.

--

___
Python tracker 

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



[issue35267] reproducible deadlock with multiprocessing.Pool

2018-11-19 Thread Neil Conway


Change by Neil Conway :


--
nosy: +nconway

___
Python tracker 

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



[issue35274] Running print("\x98") then freeze in Interpreter

2018-11-19 Thread pmpp


pmpp  added the comment:

anything not using "libvte" is fine 
i suggest you try "mlterm" a very good multilingual terminal

--

___
Python tracker 

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



[issue35274] Running print("\x98") then freeze in Interpreter

2018-11-19 Thread STINNER Victor


STINNER Victor  added the comment:

I can reproduce the issue on Fedora 29 in gnome-terminal.

Python is not blocked at all. It's just your terminal which stops displaying 
new strings. Try:

import time
print("\x98")
with open("x", "w") as fp:
fp.write("done\n")
fp.flush()
print("wait")
time.sleep(5)
print("exit")

And see file "x" created even after print("\x98").

Sorry, I'm not interested to investigate the terminal behavior.

--
nosy: +vstinner
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue35274] Running print("\x98") then freeze in Interpreter

2018-11-19 Thread pmpp


pmpp  added the comment:

LC_ALL=en_US.UTF-8  on the ssh line is the culprit
unset LC_ALL , gives same lockup result.

but:

LC_ALL=C give sames results as vnc, where no locale was set.

--

___
Python tracker 

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



[issue35280] Interactive shell overwrites history

2018-11-19 Thread dingens


New submission from dingens :

When opening two shells at the same time, history from the one that is closed 
first gets lost.

Steps to reproduce:
- let's call the contents of the history before this experiment `z`
- open two interactive shells called A and B
- execute commands in them, say `a` and `b`, respectively
- close shell A
- close shell B

Actual behavior:
- history contains `z` then `b`

Expected behavior:
- history contains `z` then `a` then `b`

possibly related: issue22940

--
messages: 330103
nosy: dingens
priority: normal
severity: normal
status: open
title: Interactive shell overwrites history
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue35274] Running print("\x98") then freeze in Interpreter

2018-11-19 Thread pmpp


pmpp  added the comment:

hi i can reproduce with a ubuntu bionic or mint19 client toward a python3.4.3 
reached via ssh server:

 - via mate-terminal or terminator  :

same behaviour as OP report


 - meanwhile using the same python3 directly via vnc + xterm gives :


pm / # python3
Python 3.4.3 (default, Nov 12 2018, 22:25:49) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print( chr(152) )
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'ascii' codec can't encode character '\x98' in position 0: 
ordinal not in range(128)
>>>

--
nosy: +pmpp

___
Python tracker 

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



[issue35279] asyncio uses too many threads by default

2018-11-19 Thread Vojtěch Boček

New submission from Vojtěch Boček :

By default, asyncio spawns as many as os.cpu_count() * 5 threads to run I/O on. 
When combined with beefy machines (e.g. kubernetes servers) with, says, 56 
cores, it results in very high memory usage.

This is amplified by the fact that the `concurrent.futures.ThreadPoolExecutor` 
threads are never killed, and are not re-used until `max_workers` threads are 
spawned.

Workaround:


loop.set_default_executor(concurrent.futures.ThreadPoolExecutor(max_workers=8))

This is still not ideal as the program might not need max_workers threads, but 
they are still spawned anyway.

I've hit this issue when running asyncio program in kubernetes. It created 260 
idle threads and then ran out of memory.

I think the default max_workers should be limited to some max value and 
ThreadPoolExecutor should not spawn new threads unless necessary.

--
components: asyncio
messages: 330101
nosy: Vojtěch Boček, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio uses too many threads by default
type: resource usage
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



[issue35278] [security] directory traversal in tempfile prefix

2018-11-19 Thread STINNER Victor


Change by STINNER Victor :


--
title: directory traversal in tempfile prefix -> [security] directory traversal 
in tempfile prefix

___
Python tracker 

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



[issue35278] directory traversal in tempfile prefix

2018-11-19 Thread STINNER Victor


STINNER Victor  added the comment:

Ruby handled this issue as a vulnerability:
https://www.ruby-lang.org/en/news/2018/03/28/unintentional-file-and-directory-creation-with-directory-traversal-cve-2018-6914/

The doc of "gettempprefix" says "This does not contain the directory 
component", so it is natural for users to think "prefix" will accept only a 
file name.

Maybe we can silently truncated the directort part of the prefix to only keep 
the base name in stable branches, but raise an exception in Python 3.8? Or 
maybe emit a deprecation warning in Python 3.7?

--
nosy: +vstinner

___
Python tracker 

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



[issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created

2018-11-19 Thread Ryan Zoeller


Change by Ryan Zoeller :


--
nosy: +rtzoeller

___
Python tracker 

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



[issue35277] Upgrade bundled pip/setuptools

2018-11-19 Thread Donald Stufft


Donald Stufft  added the comment:

It doesn't bother me if you want to make that change, I don't currently have 
the time to do it. I just figured I'd throw the update PRs up since I can do it 
quickly.

--

___
Python tracker 

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



[issue35277] Upgrade bundled pip/setuptools

2018-11-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9844

___
Python tracker 

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



[issue35277] Upgrade bundled pip/setuptools

2018-11-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9845

___
Python tracker 

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



[issue35277] Upgrade bundled pip/setuptools

2018-11-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9846

___
Python tracker 

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



[issue35277] Upgrade bundled pip/setuptools

2018-11-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It would be better to not add the bundle in the git repository, but add an 
external dependency like for Tcl/Tk on Windows. Every new release of 
pip+setuptools increases the size of the git repository by around 2 MiB. This 
will be the fourth update in 2018. There were 9 updates in 2016.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35278] directory traversal in tempfile prefix

2018-11-19 Thread Yusuke Endoh


New submission from Yusuke Endoh :

Hello,

The tempfile library does not check the prefix argument, which can be exploited 
to create files outside tmpdir by using directory traversal.

```
>>> import tempfile
>>> tempfile.gettempprefix()
'tmp'
>>> f = tempfile.NamedTemporaryFile(prefix="/home/mame/cracked")
>>> f.name
'/home/mame/crackedlt3y_ddm'
```

The same issue was found and treated as a vulnerability in PHP (CVE-2006-1494) 
and Ruby (CVE-2018-6914).

I first reported this issue to secur...@python.org at July 2018.  Some people 
kindly discussed it, and finally I was told to create a ticket here.

--
components: Library (Lib)
messages: 330097
nosy: Yusuke Endoh
priority: normal
severity: normal
status: open
title: directory traversal in tempfile prefix
type: security
versions: Python 3.8

___
Python tracker 

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



[issue35277] Upgrade bundled pip/setuptools

2018-11-19 Thread Donald Stufft


Change by Donald Stufft :


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

___
Python tracker 

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



[issue35277] Upgrade bundled pip/setuptools

2018-11-19 Thread Donald Stufft


New submission from Donald Stufft :

Upgrade the bundled pip/setuptools to the latest version.

Making this issue because blurb gets mad at me if I try to add a news entry 
without a bpo issue.

--
assignee: dstufft
components: Library (Lib)
messages: 330096
nosy: dstufft
priority: normal
severity: normal
status: open
title: Upgrade bundled pip/setuptools
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35276] Document thread safety

2018-11-19 Thread STINNER Victor


STINNER Victor  added the comment:

"Proces-wide" vs "thread-safe" is one thing. Another interesting property is 
"reentrant", but maybe that's too wide?

Somehow related, iterating on a container and modify it may or may not work 
depending on the container type and the kind of modifications.

--

> bpo-8865: select.poll is not thread safe

I checked select documentation, it doesn't mention "thread" anywhere :-(

https://docs.python.org/dev/library/select.html#poll-objects

--

___
Python tracker 

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



[issue35275] Reading umask (thread-safe)

2018-11-19 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, let's move to bpo-35276: "Document thread safety".

--

___
Python tracker 

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



[issue35276] Document thread safety

2018-11-19 Thread STINNER Victor


New submission from STINNER Victor :

Many developers only discover that a Python function/module is not thread safe 
because they have a bug in production...

Some examples:

* bpo-7672: ssl
* bpo-8865: select.poll is not thread safe
* bpo-539175, bpo-21216: socket.gethostbyname()
* bpo-7980: time.strptime()
* bpo-6647: warnings.catch_warnings()
* bpo-11077, bpo-33479: Tkinter
* bpo-1336, bpo-19809: subprocess on Python 2
* bpo-15329: deque
* bpo-35275: os.umask()

Hopefully, sometimes it was possible to fix it:

* bpo-3139: bytearray, buffer protocol
* bpo-28969: @functools.lru_cache
* bpo-21291: subprocess.Popen.wait()

In the asyncio documentation, I explicitly documented that, by design, most 
classes are not thread-safe. For example, asyncio.Lock() is *NOT* thread-safe:
https://docs.python.org/dev/library/asyncio-sync.html#asyncio.Lock

Maybe we should start to use a standard way to describe "thread safety". See 
"POSIX Safety Concepts" of the GNU libc:

https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html#POSIX-Safety-Concepts

Example with setlocale, "MT-Unsafe":

https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html

--

My own (incomplete) list of "process-wide states":
https://vstinner.readthedocs.io/threads.html#process-wide

--
assignee: docs@python
components: Documentation
messages: 330093
nosy: docs@python, vstinner
priority: normal
severity: normal
status: open
title: Document thread safety
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



[issue22121] IDLE should start with HOME as the initial working directory

2018-11-19 Thread Steve Dower


Steve Dower  added the comment:

I still think the best option is a command line flag like "--open-in-homedir" 
that causes Idle to do a chdir to the user's documents folder. This way we can 
put a static option in the start menu item in the installer and not worry about 
the limitations of MSI, etc. These limitations also exist in MSIX (app store 
packages) which is coming soon as well.

Alternatively, we could check the current directory to see if it matches 
sys.prefix (or whatever it matches) and chdir in that case. No option needed.

For reference, VS Code requires "code.exe ." to start in the current directory, 
and otherwise uses its default no matter where you start it from.

--

___
Python tracker 

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



[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2018-11-19 Thread Steve Dower


Steve Dower  added the comment:

Looks like it's available.

It will be a new subprocess option to not create a new window. The underlying 
issue is that some applications always request a console, and if your own 
application doesn't have one then Windows will create it. Normally you would 
fix this in the target application, but we can offer an option to try and force 
any new windows to be hidden (though as Eryk points out, it may cause 
unexpected behaviour and so should not be the default).

--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue35268] Windows asyncio reading continously stdin and stdout Stockfish

2018-11-19 Thread Steve Dower


Steve Dower  added the comment:

Are you awaiting those calls (and the write())? I can't tell at first glance 
whether you need to, but it seems like missing await there would cause your 
problem.

--

___
Python tracker 

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



[issue8987] Distutils doesn't quote Windows command lines properly

2018-11-19 Thread Steve Dower


Steve Dower  added the comment:

There's been progress in terms of setuptools eventually adopting distutils, so 
that looks likely and we're basically planning on it. Adding this as an 
enhancement to setuptools is going to be a better approach than adding it to 
distutils in my opinion.

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



[issue35274] Running print("\x98") then freeze in Interpreter

2018-11-19 Thread otst

otst  added the comment:

I used GNOME Terminal 3.28.2.

I tried advised code Gnome Terminal and LXTerminal 0.3.1.
but stop after first time() function.

results:
1542621412.508629 (stop. Control+D later)˜ 1542621412.5086305
1542621412.5087285
>>> 
KeyboardInterrupt
>>> 



Tried change '\x98' to '\x97' results:
1542621365.7332687  1542621365.73327
1542621365.733405



'\x97' is no problem. Perhaps the encoding may be affecting it.
I used UTF-8 on the terminal. I changed the SHIFT_JIS and tried print('\x98'), 
but it did not stop.



As a result of trying a little, what was okay:
SHIFT_JIS
ISO-2022-KR
IBM850
GBK



Also, I am Japanese and my computer is in Japanese environment.

--

___
Python tracker 

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



[issue35275] Reading umask (thread-safe)

2018-11-19 Thread STINNER Victor


STINNER Victor  added the comment:

My own (incomplete) list of "process-wide states":
https://vstinner.readthedocs.io/threads.html#process-wide

--

___
Python tracker 

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



[issue35244] Allow to setup Clang as default compiler for modules build

2018-11-19 Thread Steve Dower


Steve Dower  added the comment:

You might consider adding this support to setuptools rather than CPython. The 
distutils module is basically closed to non-essential enhancements like this, 
and will eventually be deprecated for public use (which means totally unused on 
Windows and only used to build CPython itself on other platforms).

Setuptools will merge in what it needs to cover existing scenarios and will 
become a required dependency for distutils-like builds. So eventually it will 
end up only in there anyway, and people will get to use it sooner if you start 
by putting it in setuptools.

--
stage:  -> test needed
type:  -> enhancement
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



[issue35275] Reading umask (thread-safe)

2018-11-19 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe the Python documentation can be enhanced to document functions which are 
known to have a side-effect "process-wide" vs "thread-safe" functions. For 
example, signal.pthread_sigmark() affects the current thread, wheras 
locale.setlocale() is process-wide.

See "POSIX Safety Concepts" of the glibc:

https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html#POSIX-Safety-Concepts

Example with setlocale, "MT-Unsafe":

https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html

--
nosy: +vstinner

___
Python tracker 

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



[issue35275] Reading umask (thread-safe)

2018-11-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is no thread way to read the umask in C as well. The os module provides 
thin wrappers to the POSIX API. os.umask() acts exactly as a C function 
umask(). If thread safe method be added in the POSIX API we can expose it in 
the os module.

--
nosy: +serhiy.storchaka
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



[issue35275] Reading umask (thread-safe)

2018-11-19 Thread Thomas Guettler


New submission from Thomas Guettler :

Up to now there is no thread way to read the umask in Python

https://stackoverflow.com/questions/53227072/reading-umask-thread-safe

You can use this pattern:

current_umask = os.umask(0)  # line1
os.umask(current_umask)  # line2
return current_umask

A thread which executes between line1 and line2 will have a different umask.

I would be great, if the python standard library would provide correspondig 
thread safe method.

Related question at stackoverflow: 
https://stackoverflow.com/questions/53227072/reading-umask-thread-safe

--
messages: 330083
nosy: guettli
priority: normal
severity: normal
status: open
title: Reading umask (thread-safe)

___
Python tracker 

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



[issue25083] Python can sometimes create incorrect .pyc files

2018-11-19 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed

___
Python tracker 

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



[issue35200] Make the half-open range behaviour easier to teach

2018-11-19 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

On Sun, Nov 18, 2018 at 10:27:11PM +, Julien Palard wrote:
> 
> Julien Palard  added the comment:
> 
> If I understand correctly, you'd like str(range(10)) to return " [1, 2, ..., 8, 9]>"?

Exactly the same as you suggested for repr(range(10)) to return, so yes.

> I'm really unconfortable doing this, for me __str__ is here to return 
> an “informal or nicely printable string representation of an object", 

I think that the output you suggested is an informal AND nicely 
printable string representation of the object. In what way do you think 
it fails?

It's an *informal* representation in the sense that it doesn't mimic the 
range constructor, you can't evaluate it, it isn't even legal Python 
syntax.

"Nicely printable" is a matter of taste, but I think its quite nice 
(just not suitable for use as the repr), and especially nice for the 
purpose of showing the kind of object we're dealing with, rather than 
just the values in it.

> not a convoluted "<{type(object)} object ...>" notation.

If this is too convoluted for str(), why is it suitable for beginners 
when it goes through repr() instead?

> I agree with you, the [0, 1, ..., 8, 9] notation is too confusing with 
> the repr of a list, that's why I proposed the "0, 1, ..., 8, 9" which 
> looks nice.

Except that it gives no clue that it is a range object, and fails for 
empty ranges.

--

___
Python tracker 

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



[issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers

2018-11-19 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0e1312c959dcfd0193ed0c7ab3fd45d440da6d78 by Victor Stinner in 
branch '3.7':
bpo-35233: test_embed: fix filesystem encoding (GH-10597)
https://github.com/python/cpython/commit/0e1312c959dcfd0193ed0c7ab3fd45d440da6d78


--

___
Python tracker 

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



[issue35233] _PyMainInterpreterConfig_Copy() doesn't copy install_signal_handlers

2018-11-19 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9842

___
Python tracker 

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



[issue35244] Allow to setup Clang as default compiler for modules build

2018-11-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Of course you can, good luck, if you need help ping us.

--

___
Python tracker 

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



[issue35244] Allow to setup Clang as default compiler for modules build

2018-11-19 Thread Dong-hee Na

Dong-hee Na  added the comment:

@matrixise

Hi, Stéphane

Can I take a look at this issue if no one works on it?

I have contributed to CPython, but it seems to be a good opportunity to 
contribute to a larger module.

One more thing,
It would be a good guide if you let me know what
I should pay attention to when solving this issue.

Thanks

--
nosy: +corona10

___
Python tracker 

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



[issue35274] Running print("\x98") then freeze in Interpreter

2018-11-19 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I'm afraid I can't reproduce that in Python 3.5.2 or 3.6.4.

Can you try this?

from time import time
print(time(), '\x98', time()); print(time())

and copy and paste the results.

What terminal/console are you using? If you change to a different console, does 
the problem go away?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue25988] collections.abc.Indexable

2018-11-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9841

___
Python tracker 

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