[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9948

___
Python tracker 

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



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9947

___
Python tracker 

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



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4bb186d7e253ad4def875305e06690181e923dfd by Serhiy Storchaka in 
branch 'master':
bpo-32035: Fix words about strings and bytes in zipfile documentation. 
(GH-10592)
https://github.com/python/cpython/commit/4bb186d7e253ad4def875305e06690181e923dfd


--

___
Python tracker 

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



[issue35259] Py_FinalizeEx unconditionally exists in Py_LIMITED_API

2018-11-24 Thread Martin Panter

Martin Panter  added the comment:

I added the Py_FinalizeEx API in Issue 5319, but was relying on input from 
others about dealing with Py_LIMITED_API. After reading the documentation 
, I now see that the function 
would be considered part of the limited API because its documentation doesn’t 
say otherwise. So Arthur’s resolution is correct.

--

___
Python tracker 

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



[issue35309] Typo in urllib.request warning: cpath → capath

2018-11-24 Thread John Hiatt


John Hiatt  added the comment:

I fixed this. Can you help me get it into the official repository?

--
nosy: +hiaji

___
Python tracker 

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



[issue35300] Document what functions are suitable for use with the lru_cache

2018-11-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The proposed addition looks good to me.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion

2018-11-24 Thread STINNER Victor


STINNER Victor  added the comment:

C locale coercion is just one parameter used to select the Python
filesystem enconding. There are many others which are read later during
Python initialization, and they are inter-dependent.

https://github.com/python/cpython/blob/7f4ba4afd47f21f61de9035544809fc67d136f35/Include/coreconfig.h#L69

I don't see which problem you are trying to solve here.

For me, PYTHONCOERCECLOCALE environment variable must be ignored when -I or
-E is used, for security reasons and to get more deterministic behavior. So
I am opposed to read/enable C locale coercion earlier.

That's also why PYTHONMALLOC only change the memory allocator late in the
Python initialisation, whereas it would be simpler to read/apply the option
earlier.

For the FreeBSD CURRENT bug, I recently modified Python to use ASCII if
"force ASCII" mode is enabled. I made this change for... HP-UX! On FreeBSD,
the filesystem encoding was already ASCII in practice (FreeBSD uses Latin1
but announes ASCII!?). I am not surprised to see bugs on specific
configuration with special option (disable UTF-8 mode) :-)

I am fixing Unicode bugs on weird cased before 3.0 and we are still not
done! Recently I fixed a bug in localeconv() when LC_MONETARY uses a
different encoding than LC_CTYPE... Such config sounds like a bad choice,
but well, it "works" on Python2...

--

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


Change by STINNER Victor :


--
components: +Interpreter Core

___
Python tracker 

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



[issue35309] Typo in urllib.request warning: cpath → cpath

2018-11-24 Thread Jakub Wilk

New submission from Jakub Wilk :

It should be "capath", not "cpath", in this warning:

DeprecationWarning: cafile, cpath and cadefault are deprecated, use a custom 
context instead.

--
components: Library (Lib)
messages: 330379
nosy: jwilk
priority: normal
severity: normal
status: open
title: Typo in urllib.request warning: cpath → cpath

___
Python tracker 

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



[issue35309] Typo in urllib.request warning: cpath → capath

2018-11-24 Thread Jakub Wilk

Change by Jakub Wilk :


--
title: Typo in urllib.request warning: cpath → cpath -> Typo in urllib.request 
warning: cpath → capath

___
Python tracker 

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



[issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion

2018-11-24 Thread Nick Coghlan


Nick Coghlan  added the comment:

If I've understood https://bugs.python.org/issue35290 and its resolution in 
https://github.com/python/cpython/commit/f6e323ce322cf54b1a9e9252b13f93ebc28b5c24
 correctly, that's a concrete example of why I consider the early coercion 
approach that avoids any kind of redecoding dance significantly more robust 
against issues arising from future changes in the CPython startup sequence.

I'm away for AWS Re:Invent until Dec 2, but after I get back, I'll finally sit 
down and take one last pass over this to see if I can come up with a version 
that Victor is actually willing to review and approve.

--
nosy: +vstinner

___
Python tracker 

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



[issue35308] webbrowser regression: BROWSER env var not respected

2018-11-24 Thread Zhiming Wang


Change by Zhiming Wang :


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

___
Python tracker 

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



[issue35308] webbrowser regression: BROWSER env var not respected

2018-11-24 Thread Zhiming Wang


Change by Zhiming Wang :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35308] webbrowser regression: BROWSER env var not respected

2018-11-24 Thread Zhiming Wang


New submission from Zhiming Wang :

This is a regression in Python 3.7:

$ BROWSER=w3m python3.6 -c 'import sys; import webbrowser; 
print(sys.version); print(webbrowser.get()); print(webbrowser._tryorder)'
3.6.7 (default, Nov 24 2018, 09:47:01)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]

['w3m', 'MacOSX', 'chrome', 'firefox', 'safari', 'w3m']

$ BROWSER=w3m python3.7 -c 'import sys; import webbrowser; 
print(sys.version); print(webbrowser.get()); print(webbrowser._tryorder)'
3.7.1 (default, Nov 24 2018, 09:35:18)
[Clang 10.0.0 (clang-1000.11.45.5)]

['MacOSX', 'chrome', 'firefox', 'safari', 'w3m', 'w3m']

Note how Python 3.7.1 webbrowser decides to choose MacOSX as the default 
although BROWSER is explicitly set to w3m. (The above code does not run on 
Python 3.7.0 due to bpo-31014).

This is because of misinterpretation of the `preferred` kwarg when bpo-31014 
was fixed. See 
https://github.com/python/cpython/commit/25b804a9c21c735ce322877f105ebab2539ccfc1#diff-546766353a40839aa72374ecca5b0925R566.
 Browsers in BROWSER should be registered as `preferred=True` instead.

--
components: Library (Lib)
messages: 330377
nosy: zmwangx
priority: normal
severity: normal
status: open
title: webbrowser regression: BROWSER env var not respected
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue35307] Command line help example is missing "--prompt" option

2018-11-24 Thread HolgerFrey


New submission from HolgerFrey :

In the documentation of the command line options of the "vent" module, the 
option "--prompt" is missing:

Current text:
> [...]
> 
> The command, if run with -h, will show the available options:
> 
> usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
>  [--upgrade] [--without-pip]
>  ENV_DIR [ENV_DIR ...]
> 
> [...]

The prompt option is also missing in the rest of the example output

output of python3 -m venv -h:
> python3 -m venv -h
> usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
> [--upgrade] [--without-pip] [--prompt PROMPT]
> ENV_DIR [ENV_DIR ...]
> [...]

--
assignee: docs@python
components: Documentation
messages: 330376
nosy: daftwullie, docs@python
priority: normal
severity: normal
status: open
title: Command line help example  is missing "--prompt" option
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



[issue34160] ElementTree not preserving attribute order

2018-11-24 Thread Ned Batchelder


Ned Batchelder  added the comment:

I happen to use xml.dom.minidom, though I didn't mean this to be, "fix Ned's 
personal problem" :)

--

___
Python tracker 

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



[issue28247] Add an option to zipapp to produce a Windows executable

2018-11-24 Thread Paul Moore


Paul Moore  added the comment:

While I can see your point, I'm a little skeptical that anyone who's able to 
write C source code and compile it can't work out how to combine two binary 
files... :-)

--

___
Python tracker 

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



[issue35301] python.exe crashes - lzma?

2018-11-24 Thread Jonathan


Jonathan  added the comment:

In total my python.exe process crashed 6 times with the exact same error, 
compressing about 60,000 pages, so about 1 in 10,000 failed.
However, I have ran the same process monthly for the last several months and it 
has never done that before despite processing mostly the same sites and 
compressing similar quantities of pages. The code is completely unchanged from 
last month.

Upon reflection, the only thing that has changed since then is that I am now 
running BOINC (https://boinc.berkeley.edu/) in the background on the machine. 
So I have just re-ran the entire process with BOINC suspended. Not a single 
crash!
It seems that somehow BOINC and Python are interacting to cause Python to crash.

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2018-11-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am working on adding a canonization support (issue13611 for ElementTree and 
perhaps separate issue for minidom), but prefer to keep this issue open for the 
case if this task turns out to be too difficult.

Ned, what module is used in your tests for serialization? minidom or 
ElementTree?

--

___
Python tracker 

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