[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-03-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 8a1bab92915dd5c88832706c56af2f5611181d50 by Terry Jan Reedy in 
branch 'master':
bpo-34162: Add entries for idlelib/NEWS.txt (#12232)
https://github.com/python/cpython/commit/8a1bab92915dd5c88832706c56af2f5611181d50


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-03-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12219

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset 02351ed1ba601445735c6a6eae6f9b1d37fae8cd by Miss Islington (bot) 
in branch '3.7':
bpo-34162: Add entries for idlelib/NEWS.txt (GH-12232)
https://github.com/python/cpython/commit/02351ed1ba601445735c6a6eae6f9b1d37fae8cd


--

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

As the documentation says, the API is intended as fairly portable 
implementation of the Unix uname helper across platforms. It's fine to redirect 
this directly to e.g. /proc output instead of using the executable, but in 
whatever you do here, the output of platform.uname() needs to stay compatible 
to what the function returned prior to such a change, which usually means: to 
the output of the uname helper on a system.

Could you please check that on most systems, the output remains the same ?

Thanks.

--

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Stefan Behnel


Stefan Behnel  added the comment:

The feature seems reasonable to me and the patch looks good.

--

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue31256.

I do not know what is better: make tostring() to accept all options of write(), 
or keep it simpler. What strategy lxml supports?

--

___
Python tracker 

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



[issue36230] Please sort assertSetEqual's output

2019-03-08 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

@rhettinger
> It's possible to have non-sortable elements in the set, so you'll either need 
> to sort on the repr of the elements or have a fallback

Yes, it is the repr that is used in the loop and that what's the sorting needs 
to be done against.


@Windson Yang
> we should compare their repr() without sort() like now.

I'm not sure to understand, can you provide more information about what you are 
thinking of?

Is there a reason to add 2.7, 3.4, 3.5, 3.6 and 3.7 to versions affected ?

As far as I can tell, this is a new feature and should only go in 3.8.

--

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Stefan Behnel


Stefan Behnel  added the comment:

lxml does not support the "default_namespace" option specifically (because its 
tree model preserves namespace prefixes), but it generally makes all 
(justifiable) serialisation options available to both tostring() and ET.write().

I think the same should apply to ElementTree. Both the "default_namespace" and 
"doctype" options seem useful regardless of the serialisation target.

--

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-08 Thread Марат Нагаев

Марат Нагаев  added the comment:

Oh, __floor__ can return anything.
So I suggest:
1. Methods __floor__ and __ceil__ for complex object.
2. Don't change __float__ and __int__ methods.
3. So I think it isn't nessesary to add methods floor and ceil to complex 
module.
Example:
from math import *
z=1.1+1.1j
floor(z) #1+1j, same as z.__floor__()
ceil(z) #2+2j, samse as z.__ceil__()

--

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Okay. Bernt, do you mind to add also the xml_declaration option in PR 12225 or 
create a separate PR for issue31256?

--

___
Python tracker 

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



[issue36231] no "proper" header files on macOS 10.14 Mojave

2019-03-08 Thread Dmitrii Pasechnik


New submission from Dmitrii Pasechnik :

Neither Xcode nor its command-line tools on macOS 10.14 Mojave come with header 
files installed in /usr/ and other "normal" directories.

This is not documented in https://devguide.python.org/setup/#macos-and-os-x

While an extra step to handle this, i.e. to install the headers, is available 
(see a discussion on https://bugs.python.org/issue34956), Apple stated that 
this workaround will disappear.

It is thus highly desirable to provide a way to deal with headers located not 
at /usr/include, but at `xcrun --show-sdk-path`/usr/include.
A small change in setup.py along the lines of the following:

--- a/setup.py
+++ b/setup.py
@@ -134,7 +134,8 @@ def macosx_sdk_root():
 cflags = sysconfig.get_config_var('CFLAGS')
 m = re.search(r'-isysroot\s+(\S+)', cflags)
 if m is None:
-sysroot = '/'
+import subprocess
+sysroot = subprocess.check_output(["xcrun", 
"--show-sdk-path"]).decode("utf-8").strip('\n')
 else:
 sysroot = m.group(1)
 return sysroot
@@ -146,6 +147,7 @@ def is_macosx_sdk_path(path):
 """
 return ( (path.startswith('/usr/') and not path.startswith('/usr/local'))
 or path.startswith('/System/')
+or path.startswith('/Applications/')
 or path.startswith('/Library/') )

with the necessary changes to enable various modules (see attachment for a 
complete POC diff against the current master), the result builds and passes all 
the (enabled) tests on an OSX 10.13 system with empty /usr/include and 
/usr/local/include containing only LZMA headers.

Needless to say, a proper patch would not modify Modules/Setup, it'd adjust 
configure.ac etc.

--
components: macOS
files: noincludedirs_OSX.patch
keywords: patch
messages: 337461
nosy: dimpase, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: no "proper" header files on macOS 10.14 Mojave
type: compile error
versions: Python 3.8
Added file: https://bugs.python.org/file48192/noincludedirs_OSX.patch

___
Python tracker 

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



[issue36232] Improve error message on dbm.open

2019-03-08 Thread Marco Rougeth


New submission from Marco Rougeth :

If dbm.open is used with the flags 'r' or 'w' (read-only) to open a file that 
doesn't exist, it raises an exception with the message "need 'c' or 'n' flag to 
open new db". It'd be better to have a more explicit error message like "db 
file doesn't exist, use 'c' or 'n' flag to open new db".

--
messages: 337462
nosy: rougeth
priority: normal
pull_requests: 12220
severity: normal
status: open
title: Improve error message on dbm.open

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Johann Krauter


New submission from Johann Krauter :

I have the problem, that a xml file is save with the following xml declaration: 
 
instead of 


I would propose to change the line number 769 in the ElementTree.py to: 
write("\n" % (
declared_encoding,))

--
components: XML
files: ElementTree.py
messages: 337463
nosy: Photoniker
priority: normal
severity: normal
status: open
title: xml ElementTree quotation marks of xml version string
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48193/ElementTree.py

___
Python tracker 

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



[issue36234] test_os: add tests for invalid uid type

2019-03-08 Thread STINNER Victor


New submission from STINNER Victor :

The Fedora package of python contains a downstream patch to add more tests for 
invalid uid types:
https://src.fedoraproject.org/rpms/python2/blob/master/f/00157-uid-gid-overflows.patch

I propose to make this patch upstream. More tests never hurts :-)

uid/gid overflow has been fixed bpo-4591.

The patch comes from:
https://bugzilla.redhat.com/show_bug.cgi?id=697470

Attached PRs add more tests.

--
components: Tests
messages: 337464
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_os: add tests for invalid uid type
versions: Python 2.7, 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



[issue36234] test_os: add tests for invalid uid type

2019-03-08 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
Added file: https://bugs.python.org/file48194/00157-uid-gid-overflows.patch

___
Python tracker 

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



[issue36234] test_os: add tests for invalid uid type

2019-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

See _Py_Uid_Converter() and _Py_Gid_Converter() of Modules/posixmodule.c.

--

___
Python tracker 

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



[issue36234] test_os: add tests for invalid uid type

2019-03-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12221
stage:  -> patch review

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

> So I suggest:
> 1. Methods __floor__ and __ceil__ for complex object.

What's the use-case for these? It's not a particularly natural operation, and 
I've never had a need for a complex "floor" operation, either as a 
mathematician or as a developer. Do you have an example of real-world code that 
would benefit?

For those rare cases where this is needed, it isn't that hard to spell out 
`complex(floor(z.real), floor(z.imag))`, or to write a custom `complex_floor` 
function.

Also, what type should `math.floor` return when applied to a complex number? 
`math.floor` of a `float` object returns an `int`, so the analogous operation 
on a complex number should return a Gaussian integer. But we don't have a 
Gaussian integer type in standard Python, and it wouldn't be appropriate to add 
one.

--

___
Python tracker 

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



[issue36230] Please sort assertSetEqual's output

2019-03-08 Thread Windson Yang


Windson Yang  added the comment:

My point is careful about the non-sortable object. My mistake, this should be 
an enhancement, not a bug.

--
versions:  -Python 2.7, Python 3.4, Python 3.5, 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



[issue36234] test_os: add tests for invalid uid type

2019-03-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +1

___
Python tracker 

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



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

2019-03-08 Thread STINNER Victor


New submission from STINNER Victor :

When a C extension is built by distutils, 
distutils.sysconfig.customize_compiler() is used to configure compiler flags. 
Extract of the code:

(cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')

...
if 'CFLAGS' in os.environ:
cflags = opt + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']
cflags = cflags + ' ' + os.environ['CPPFLAGS']
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
...

If the CFLAGS environment variable is set, the 'CFLAGS' configuration variable 
is overriden with the 'OPT' configuration variable: cflags = opt + ...

This bug has been fixed since 2013 in Fedora and RHEL by this patch:
https://src.fedoraproject.org/rpms/python2/blob/master/f/00168-distutils-cflags.patch

RHEL bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=849994

I converted that patch to a pull request.

--
components: Build
messages: 337468
nosy: vstinner
priority: normal
severity: normal
status: open
title: distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT 
var if CFLAGS env var is set
versions: Python 2.7, 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



[issue36236] Python crash on macOS when CWD is invalid

2019-03-08 Thread László Kiss Kollár

New submission from László Kiss Kollár :

CPython crashes with "pymain_compute_path0: memory allocation failed" when 
attempting to execute it with a library module from a previously deleted 
directory.

To reproduce:

cd ~/tmp/python_crash

rm -rf ~/tmp/python_crash

python3.7 -m pdb
Fatal Python error: pymain_compute_path0: memory allocation failed
ValueError: character U+ef3a8fe0 is not in range [U+; U+10]

Current thread 0x00011060e5c0 (most recent call first):

--
components: macOS
messages: 337469
nosy: lkollar, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python crash on macOS when CWD is invalid
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



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

2019-03-08 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36236] Python crash on macOS when CWD is invalid

2019-03-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is happening because _Py_wgetcwd returns NULL (although the underliying 
getcwd system call populates the `fullpath` variable correctly) but its caller, 
_PyPathConfig_ComputeArgv0, does not check the return value:

_Py_wgetcwd(fullpath, Py_ARRAY_LENGTH(fullpath));
 argv0 = fullpath;

 and its caller, pymain_run_python, interprets a failure in 
_PyPathConfig_ComputeArgv0 as a memory problem:

 PyObject *path0 = _PyPathConfig_ComputeArgv0(config->argc,
  config->argv);
 if (path0 == NULL) {
 err = _Py_INIT_NO_MEMORY();
 goto done;
 }

--
nosy: +pablogsal

___
Python tracker 

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



[issue36236] Python crash on macOS when CWD is invalid

2019-03-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue36237] data_files / Install Additional Files written unclearly such that it's not obvious what parameter is what

2019-03-08 Thread jt

New submission from jt :

I find the following doc section found at 
https://docs.python.org/3.7/distutils/setupscript.html#installing-additional-files
 about data_files somewhat unclear:

```
setup(...,
  data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
  ('config', ['cfg/data.cfg']),
  ('/etc/init.d', ['init-script'])]
 )

Each (directory, files) pair in the sequence specifies the installation 
directory and the files to install there.

...

The directory should be a relative path. It is interpreted relative to the 
installation prefix (Python’s sys.prefix for system installations; 
site.USER_BASE for user installations).
```

This gives me no clue what the installation actually is relative to, since e.g. 
sys.prefix is just `/usr` - surely I'm not supposed to specify 
"lib64/python3.7/site-packages//file" as a target?

That is probably not how that text is supposed to be read and I'm sure 
packaging expert understand what sort of prefix is actually meant, but could 
this be more elaborated on, maybe an actual example for a fake package of 
whether this is e.g. the package folder root after the install inside the site 
packages, or the site packages folder itself, or ...?

--
assignee: docs@python
components: Documentation
messages: 337471
nosy: docs@python, jt
priority: normal
severity: normal
status: open
title: data_files / Install Additional Files written unclearly such that it's 
not obvious what parameter is what
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



[issue36238] distutils complains "package init file 'xxx/__init__.py' not found (or not a regular file)" when using Cythonized __init__.pyx

2019-03-08 Thread jt


New submission from jt :

distutils spits out a warning:

package init file 'xxx/__init__.py' not found (or not a regular file)

... when using Cythonized __init__.pyx instead. However, the installed package 
works absolutely fine, it can be imported & used perfectly, so this warning 
seems bogus.

I checked, and this warning is generated inside distutils/command/build_py.py 
in the build_py class in method check_package(). I suggest that this warning 
isn't generated in case a C extension is found for the __init__ module, checked 
in whatever way is appropriate at this stage (e.g. by seeing if there's an 
__init__.pyx)

--
components: Distutils
messages: 337472
nosy: dstufft, eric.araujo, jt
priority: normal
severity: normal
status: open
title: distutils complains "package init file 'xxx/__init__.py' not found (or 
not a regular file)" when using Cythonized __init__.pyx
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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eli.bendersky, scoder, serhiy.storchaka

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Bernt Røskar Brenna

Bernt Røskar Brenna  added the comment:

I will add xml_declaration and push to the existing PR.

--

___
Python tracker 

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



[issue36237] data_files / Install Additional Files written unclearly such that it's not obvious what parameter is what

2019-03-08 Thread jt


jt  added the comment:

Ok I am now realizing after more tests I actually read the docs correctly, and 
in that sense they're not ambiguous.

It's just that I tried to use data_files for something that it's not for: I did 
look at package_data first and I get that's what I SHOULD be using, however I 
want to add in a file that isn't in the package root in the original source 
folder. (package is in "./src", file I want to add in is in "./") package_data 
seems unable to do this, so I thought data_files would get me there, but 
apparently not in any reasonable way.

Closing this since I was apparently just surprised it didn't do what I want, 
and didn't actually misread anything as I thought I had

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

It won't be possible in general to emit what the function returned before, as 
`uname` is a symbolic reference to an arbitrary executable, which can vary by 
platform and release and local environment.

What I might be able to do is find the implementation of "uname" and see if 
there's a way to get the value from the same source. I did find what I believe 
is the [canonical 
source](https://github.com/coreutils/coreutils/blob/66e2daa689fefec9ed201a04696b9f52d049d89a/src/uname.c#L301-L343).

I'll explore if those calls can be translated to Python.

--

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor


New submission from STINNER Victor :

When a translation .po file contains a comment in headers, it's kept when 
compiled as .mo by msgfmt.

Example with test.po:
---
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Plural-Forms:  nplurals=2; plural=(n != 1);\n"
"#-#-#-#-#  plo.po (PACKAGE VERSION)  #-#-#-#-#\n"
---

Compile it with "msgfmt". Parse the output file messages.mo using test.py 
script:
---
import gettext, pprint
with open("messages.mo", "rb") as fp:
t = gettext.GNUTranslations()
t._parse(fp)
pprint.pprint(t._info)
---

Output on Python 3.7.2:
---
{'content-type': 'text/plain; charset=UTF-8',
 'plural-forms': 'nplurals=2; plural=(n != 1);\n'
 '#-#-#-#-#  plo.po (PACKAGE VERSION)  #-#-#-#-#'}
---

Output of Fedora Python 2.7.15 which contains a fix:
---
{'content-type': 'text/plain; charset=UTF-8',
 'plural-forms': 'nplurals=2; plural=(n != 1);'}
---

I'm not sure that keeping the comment as part of plural forms is correct. 
Comments should not be ignored?

I made my test on Fedora 29: msgfmt 0.19.8.1, Python 3.7.2.

Links:

* https://bugs.python.org/issue1448060#msg27754
* https://bugs.python.org/issue1475523
* https://bugzilla.redhat.com/show_bug.cgi?id=252136

Fedora has a patch since 2007 to ignore comments:
https://src.fedoraproject.org/rpms/python2/blob/master/f/python-2.5.1-plural-fix.patch

I can easily convert the patch to a PR, maybe with a test. The question is more 
if the fix is correct or not.

--
components: Library (Lib)
messages: 337476
nosy: mdk, vstinner
priority: normal
severity: normal
status: open
title: gettext: GNUTranslations doesn't parse properly comments in description
versions: Python 2.7, 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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file48195/parse.py

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file48196/comments.po

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file48197/messages.mo

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

Attached files:

* comments.po: PO file with a comment in headers
* messages.mo: comments.po compiled with msgfmt
* parse.py: Python script to parse messages.mo

--

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Bernt Røskar Brenna

Bernt Røskar Brenna  added the comment:

I pushed changes to the PR. I also added xml_declaration and default_namespace 
to the tostringlist() method.

--

___
Python tracker 

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



[issue31256] xml.etree.ElementTree: add support for doctype in tostring method

2019-03-08 Thread Bernt Røskar Brenna

Change by Bernt Røskar Brenna :


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

___
Python tracker 

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



[issue31256] xml.etree.ElementTree: add support for doctype in tostring method

2019-03-08 Thread Bernt Røskar Brenna

Bernt Røskar Brenna  added the comment:

See also: https://bugs.python.org/issue36227

PR: https://github.com/python/cpython/pull/12225

--
nosy: +Bernt.Røskar.Brenna

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Thanks. It would be good to do some before/after tests on popular
platforms, e.g. a few Linuxes, MacOS, Windows.

--

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

The first call I see in that routine is to "sysinfo", but the signature of that 
function doesn't match what I find in the [man pages for that 
function](http://man7.org/linux/man-pages/man2/sysinfo.2.html). So that 
function must be coming from elsewhere.

--

___
Python tracker 

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



[issue36240] Definitions of time

2019-03-08 Thread Robert Billing


New submission from Robert Billing :

https://docs.python.org/3.7/library/time.html contains the text "UTC is 
Coordinated Universal Time (formerly known as Greenwich Mean Time, or GMT)". 
This is not strictly true. Referring to 
https://en.wikipedia.org/wiki/Coordinated_Universal_Time the definition of UTC 
is in terms of frequency standards, GMT in terms of astronomy. Hence with GMT 
each minute has exactly 60 seconds, but the length of the second may vary 
slightly to account for changes in the Earth's rotation. With UTC each second 
is the same length, but "leap seconds" can be inserted or removed giving 59 and 
61 second minutes. The leap seconds keep the two systems in sync to less than 
one second.

This of course only matters for the most critical applications, but it would be 
worth documenting correctly.

--
assignee: docs@python
components: Documentation
messages: 337482
nosy: Robert Billing, docs@python
priority: normal
severity: normal
status: open
title: Definitions of time
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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Aha! It seems the 'sysinfo' call is for Solaris: 
https://docs.oracle.com/cd/E23823_01/html/816-5167/sysinfo-2.html

--

___
Python tracker 

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



[issue35435] Discourage external links to old docs.

2019-03-08 Thread Julien Palard


Julien Palard  added the comment:

Let's not have duplicate issues, so I'm closing this in favor of 
https://github.com/python/python-docs-theme/issues/24.

Thanks Terry for noticing.

--
resolution:  -> duplicate
stage: needs patch -> 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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Best I can tell, neither sysinfo nor sysctl are exposed in any way to Python, 
so it may not be possible to accurately load the processor information from 
those system calls without writing a wrapper in C. What I might try is to 
experiment with ctypes to see if I can prove the concept.

--

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread Julien Palard


Julien Palard  added the comment:

After some research I found a few comments around comments being marked as 
starting by #-#-#-#-# and ending with #-#-#-#-#, not just starting with #.

In gettext-0.19.8.1 sources for example:

$ grep -r '#-#-#-#-' | head
gettext-tools/misc/po-mode.el:#-#-#-#-#  file name reference  #-#-#-#-#
gettext-tools/misc/po-mode.el:  (let* ((marker-regex "^#-#-#-#-#  \\(.*\\)  
#-#-#-#-#\n")
gettext-tools/src/msgl-cat.c:  char *id = xasprintf ("#-#-#-#-# 
 %s  #-#-#-#-#",

Or more precisly in `gettext-tools/tests/msgcat-10`:

# Verify msgcat of two files, when the header entries have different comments
# but the same contents. The resulting header entry is not marked fuzzy,
# because the #-#-#-#-# are only in comments and do not necessarily require
# translator attention; in other words, an msgstr which is valid in both input
# files is also valid in the result.

I'm however surprised not to find much of "#-#-#-#-#" in the source code, like 
if they are just looking a single # like you do here.

Not sure which one is the better, eliminating lines with a pair of #-#-#-#-# or 
lines starting with a #, both looks OK to me (we're only speaking about the 
header here, not the msgstr, so it won't have much impact).

Personally I'd go for eliminating #-#-#-#-# as this is the only case we've 
seen, and is the "documented" one in the GNU gettext test cases.

--

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Reading further, the 'sysctl' call seems to only be for BSD 
(https://www.freebsd.org/cgi/man.cgi?sysctl(3)). I could find the man page for 
sysctl for BSD but not Linux. There is a _sysctl in Linux 
(http://man7.org/linux/man-pages/man2/sysctl.2.html), but it's use is 
discouraged and it doesn't provide the necessary information.

Now I suspect that the aforementioned GNU coreutils 'uname' implementation is 
only for non-Linux systems, as none of the underlying system calls are relevant 
on Linux. I expect if one compiled that uname on Linux, 'uname -p' would emit 
'unknown'.

Meaning I still don't know how to get a 'uname -p' result on Linux (without 
invoking uname -p).

--

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Hmm. But if I go to the Linux man page for uname 
(https://linux.die.net/man/1/uname) and follow the links to the source code, I 
end up at the same repository. So maybe the BSD man page is suitable for Linux. 
I'll work from that assumption for now.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Both quotes are valid. See 
https://www.w3.org/TR/2008/REC-xml-20081126/#sec-prolog-dtd.

--

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

I found a .po file with "#" in headers on the Internet, Sympa mailing list 
project:
https://www.sympa.org/distribution/sympa-6.0.10/po-wwsympa/et.po:

# #-#-#-#-#  blank_web_help_et.po (sympa)  #-#-#-#-#
# Sympa online help internationalisation.
# Copyright (C) 2007
# This file is distributed under the same license as Sympa.
# FIRST AUTHOR , 2007.
#
# #-#-#-#-#  tmp_web_help_et.po (et)  #-#-#-#-#
# translation of et.po to 
# translation of et.po to
# #-#-#-#-#  et.po (PACKAGE VERSION)  #-#-#-#-#
# Copyright (C) 2005 Free Software Foundation, Inc.
# #-#-#-#-#  et.po (PACKAGE VERSION)  #-#-#-#-#
# #-#-#-#-#  et.po (PACKAGE VERSION)  #-#-#-#-#
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR , YEAR.#.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER.
# root , 2005.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: et\n"
"POT-Creation-Date: 2007-11-13 14:50+0200\n"
"PO-Revision-Date: 2007-10-22 00:03+0200\n"
"Last-Translator: Alar Sing \n"
"Language-Team: Estonian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-#  blank_web_help_et.po (sympa)  #-#-#-#-#\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"#-#-#-#-#  tmp_web_help_et.po (et)  #-#-#-#-#\n"
"X-Generator: Pootle 1.0.2\n"

They are 2 headers starting with >"#-#-#-#-# < and ending with >  #-#-#-#-#\n"<.

--

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor

STINNER Victor  added the comment:

I hacked gettext.py to parse all files of my system. I found 3 .mo files which 
contain "#" in headers:

/usr/share/locale/fa/LC_MESSAGES/digikam.mo:

{'content-transfer-encoding': '8bit\n'
  '#-#-#-#-#  digikamimageplugin_channelmixer.po '
  '(digikamimageplugin_channelmixer)  #-#-#-#-#',
 'content-type': 'text/plain; charset=UTF-8',
 'language': 'fa',
 'language-team': 'Farsi (Persian) <>',
 'last-translator': 'Mohammad Reza Mirdamadi ',
 'mime-version': '1.0',
 'plural-forms': 'nplurals=1; plural=0;',
 'po-revision-date': '2012-01-13 15:00+0330',
 'pot-creation-date': '2018-03-18 03:11+0100',
 'project-id-version': 'digikam',
 'report-msgid-bugs-to': 'http://bugs.kde.org',
 'x-generator': 'KBabel 1.11.4'}

/usr/share/locale/ia/LC_MESSAGES/akonadicontact5-serializer.mo:

{'content-transfer-encoding': '8bit\n'
  '#-#-#-#-#  akonadi_kalarm_resource.po  '
  '#-#-#-#-#',
 'content-type': 'text/plain; charset=UTF-8',
 'language': 'ia',
 'language-team': 'Interlingua ',
 'last-translator': 'g.sora ',
 'mime-version': '1.0',
 'plural-forms': 'nplurals=2; plural=n != 1;',
 'po-revision-date': '2011-11-29 19:38+0100',
 'pot-creation-date': '2018-11-12 06:56+0100',
 'project-id-version': '',
 'report-msgid-bugs-to': 'http://bugs.kde.org',
 'x-generator': 'Lokalize 1.2'}

/usr/share/locale/ml/LC_MESSAGES/ktraderclient5.mo:

{'content-transfer-encoding': '8bit',
 'content-type': 'text/plain; charset=UTF-8',
 'language': 'ml',
 'language-team': 'Swathanthra|സ്വതന്ത്ര Malayalam|മലയാളം '
  'Computing|കമ്പ്യൂട്ടിങ്ങ് ',
 'last-translator': '# ANI PETER|അനി പീറ്റര്\u200d ',
 'mime-version': '1.0',
 'plural-forms': 'nplurals=2; plural=(n != 1);',
 'po-revision-date': '2008-07-10 22:04+0530',
 'pot-creation-date': '2018-09-14 06:47+0200',
 'project-id-version': 'ktraderclient',
 'report-msgid-bugs-to': 'http://bugs.kde.org',
 'x-generator': 'KBabel 1.11.4'}

--

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread Julien Palard

Julien Palard  added the comment:

The

 'last-translator': '# ANI PETER|അനി പീറ്റര്\u200d ',

case does not looks like an issue, it does *not* starts with #, it's in the 
middle of the line, the line starts with "Last-Translator".

--

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

/usr/share/locale/fa/LC_MESSAGES/digikam.mo:

I downloaded the .po file using:

svn cat 
svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/fa/messages/extragear-graphics/digikam.po
 > fa_digikam.po

It contains many comments in headers. Extract:

(...)
# MaryamSadat Razavi , 2007.
# Nasim Daniarzadeh , 2007.
# Nazanin Kazemi , 2007.
# Mohammad Reza Mirdamadi , 2011, 2012.
msgid ""
msgstr ""
"Project-Id-Version: digikam\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n";
"POT-Creation-Date: 2019-03-08 03:08+0100\n"
"PO-Revision-Date: 2012-01-13 15:00+0330\n"
"Last-Translator: Mohammad Reza Mirdamadi \n"
"Language-Team: Farsi (Persian) <>\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-#  digikamimageplugin_channelmixer.po "
"(digikamimageplugin_channelmixer)  #-#-#-#-#\n"
"X-Generator: Lokalize 1.2\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugin_refocus.po (digikamimageplugin_refocus)  #-#-#-"
"#-#\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugin_oilpaint.po (digikamimageplugin_oilpaint)  #-#-"
"#-#-#\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugin_perspective.po "
"(digikamimageplugin_perspective)  #-#-#-#-#\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugin_freerotation.po "
"(digikamimageplugin_freerotation)  #-#-#-#-#\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugins.po (digikamimageplugins)  #-#-#-#-#\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugin_raindrop.po (digikamimageplugin_raindrop)  #-#-"
"#-#-#\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugin_blowup.po (digikamimageplugin_blowup)  #-#-#-#-"
"#\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugin_charcoal.po (digikamimageplugin_charcoal)  #-#-"
"#-#-#\n"
(...)

--

___
Python tracker 

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



[issue36157] Document PyInterpreterState_Main().

2019-03-08 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread STINNER Victor

STINNER Victor  added the comment:

/usr/share/locale/ml/LC_MESSAGES/ktraderclient5.mo:

svn cat 
svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/ml/messages/kde-workspace/ktraderclient5.po
 > ml_ktraderclient5.po

Extract:

msgid ""
msgstr ""
"Project-Id-Version: ktraderclient\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n";
"POT-Creation-Date: 2018-08-16 09:14+0200\n"
"PO-Revision-Date: 2008-07-10 22:04+0530\n"
"Last-Translator: # ANI PETER|അനി പീറ്റര്<200d> \n"
"Language-Team: Swathanthra|സ്വതന്ത്ര Malayalam|മലയാളം 
Computing|കമ്പ്യൂട്ടിങ്ങ് \n"
"Language: ml\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

--

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread Julien Palard

Julien Palard  added the comment:

That's literally sick þ Looks like we have to trust the "\n", not the file 
wrapping, but this means that:

msgstr ""
"Pro"
"jec"
"t-I"
"d-V"
"ers"
"ion"
": "
"dig"
"ika"
"m\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n";

is valid, too? I have to try it!

HAHA it is:

$ cat ~/clones/python-docs-fr/glossary.po | head -n 20
# Copyright (C) 2001-2018, Python Software Foundation
# For licence information, see README file.
#
msgid ""
msgstr ""
"Pr"
"oj"
"ec"
"t-"
"Id"
"-V"
"er"
"si"
"on"
":"
" P"
"ython 3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-21 09:48+0100\n"
"PO-Revision-Date: 2019-03-08 14:48+0100\n"

$ msgcat ~/clones/python-docs-fr/glossary.po | head -n 20
# Copyright (C) 2001-2018, Python Software Foundation
# For licence information, see README file.
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-21 09:48+0100\n"
"PO-Revision-Date: 2019-03-08 14:48+0100\n"
"Last-Translator: Jules Lasne \n"
"Language-Team: FRENCH \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.2\n"
"# Pouette\n"

--

___
Python tracker 

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



[issue36157] Document PyInterpreterState_Main().

2019-03-08 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Since there was no response, I decided to  open a PR for this.

--
keywords:  -patch
stage: patch review -> needs patch

___
Python tracker 

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



[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

2019-03-08 Thread Julien Palard


Julien Palard  added the comment:

I tested further, and when we have this horrible mess in the po files:

msgstr ""
"Pro"
"jec"
"t-I"
"d-V"
"ers"
"ion"
": "
"dig"
"ika"
"m\n"

We have a clean string in the .mo file.

So there is no fear to have of:

"Plural-Forms: nplurals=1; plural=0;\n"
"#-#-#-#-#  digikamimageplugin_raindrop.po (digikamimageplugin_raindrop)  #-#-"
"#-#-#\n"
"X-Generator: KBabel 1.11.4\n"

It will be nicely stored in the mo as:

Plural-Forms: nplurals=1; plural=0;
#-#-#-#-#  digikamimageplugin_raindrop.po (digikamimageplugin_raindrop)  
#-#-#-#-#
X-Generator: KBabel 1.11.4

So you can safely remove lines starting and ending with #-#-#-#-#.

--

___
Python tracker 

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



[issue21253] unittest assertSequenceEqual can lead to Difflib.compare() crashing on mostly different sequences

2019-03-08 Thread Ernesto Eduardo Medina Núñez

Ernesto Eduardo Medina Núñez  added the comment:

While this gets fixed, can you provide a workaround? or recommend another 
library?

--
nosy: +Ernesto Eduardo Medina Núñez

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

After fussing with sysctl for a while, I'm fairly confident that one can't use 
sysctl on Linux reliably (https://stackoverflow.com/a/55066774/70170). I'll 
keep digging to see if I can find another implementation of `uname` that's used 
on Linux.

--

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

[This answer](https://unix.stackexchange.com/a/307960/275034) is extremely 
helpful. `uname -p` isn't available on Linux except Fedora and late versions of 
Debian that apply the patch.

This lack of consistency means that `platform.uname().processor` and thus 
`platform.processor()` is an inherently unreliable interface.

--

___
Python tracker 

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



[issue36124] Provide convenient C API for storing per-interpreter state

2019-03-08 Thread Eric Snow


Eric Snow  added the comment:

On Sat, Mar 2, 2019 at 12:33 AM Armin Rigo  wrote:
> PyModule_GetState() requires having the module object that corresponds
> to the given interpreter state.  I'm not sure how a C extension module is
> supposed to get its own module object corresponding to the current
> interpreter state, without getting it from the caller in some way.

Fair enough. :)

> If you want to point out a different approach that might work too, that's OK 
> too.

As Petr noted, the preferred solution isn't feasible yet (pending
several PEPs) and depends on using multi-phase extension module
initialization (PEP 489).  Furthermore, that assumes that the
preferred solution would meet your performance needs.  If you think it
wouldn't then this is a great chance to speak up. :)

> It's just that the current approach was arrived at after multiple generations 
> of
> crash reports, which makes me uneasy about changing it in more subtle ways
> than just killing it in favor of a careful PyInterpreterState_GetDict().

Understood.

Thanks for the detailed explanation on why you are using
"interp->dict", and how you need to avoid fatal errors (e.g. from
"PyImport_GetModuleDict()" during shutdown).

Your solution seems reasonable, since every interpreter will have it's
own "modules" object.  However, note that "interp->modules" can get
swapped out with a different object at any moment.  The use case is
temporarily setting a different import state (e.g. isolating a
module's import).  Currently this isn't very common (especially since
"interp->modules" is currently not sync'ed with "sys.modules"), but we
have plans for making this easier to do from Python code in the
not-distant future.

Regardless, I agree that PyInterpreterState_GetDict() will solve
several problems for you.  I'm sorry we didn't provide this solution
for you sooner.

--

___
Python tracker 

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



[issue36241] MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"

2019-03-08 Thread andrejs-sisojevs-accenture


New submission from andrejs-sisojevs-accenture :

On download page 
https://www.python.org/downloads/release/python-2716/
MD5 checksum for "Windows x86-64 MSI installer" is 
2fe86194bb4027be75b29852027f1a79

But download file checksum is `2841e92ba89a6f036305a8a07fbe9d18`.
Checksum calculated on 2 different machines (Windows and MacOS), both strongly 
protected by antiviruses.

--
components: Installation
messages: 337502
nosy: andrejs-sisojevs-accenture
priority: normal
severity: normal
status: open
title: MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"
versions: Python 2.7

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Correction on last comment: s/Debian/Ubuntu/

--

___
Python tracker 

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



[issue36241] MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"

2019-03-08 Thread andrejs-sisojevs-accenture


andrejs-sisojevs-accenture  added the comment:

Checksum for earlier v2.7.15 is fine.

--

___
Python tracker 

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



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

2019-03-08 Thread Ned Deily


Ned Deily  added the comment:

This appears to be a duplicate of Issue969718.

--
nosy: +ned.deily

___
Python tracker 

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



[issue36124] Provide convenient C API for storing per-interpreter state

2019-03-08 Thread Eric Snow


Eric Snow  added the comment:

Also, while PyThreadState_GetDict() is the inspiration here, we don't have to 
copy it exactly.  For instance, PyInterpreterState_GetDict() takes a 
PyInterpreterState* argument, whereas PyThreadState_GetDict() takes no 
arguments and gets the PyThreadState* from thread-local storage.

Is there anything else that would make sense to do differently with 
PyInterpreterState_GetDict()?  It's pretty basic, so I'm guessing "no". :)

--

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-08 Thread Марат Нагаев

Марат Нагаев  added the comment:

>For those rare cases where this is needed, it isn't that hard to spell out 
>`complex(floor(z.real)
But in Python we have math.tau. However it's just 2*pi.
>`math.floor` of a `float` object returns an `int`
Maybe the best solution is to add functions floor and ceil to cmath module and 
edit floor and ceil function (in case passing complex argument these function 
could raise TypeError)

--

___
Python tracker 

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



[issue36242] ABC: We ask U.S. news media to interview Human Rights expert Alfred de Zayas about Venezuela.

2019-03-08 Thread Andre Dias

New submission from Andre Dias :

Olá,

Eu acabei de assinar o abaixo-assinado "ABC: We ask U.S. news media to
interview Human Rights expert Alfred de Zayas about Venezuela." e queria
saber se você pode ajudar assinando também.

A nossa meta é conseguir 1.000 assinaturas e precisamos de mais apoio. Você
pode ler mais sobre este assunto e assinar o abaixo-assinado aqui:

http://chng.it/nnZvDGFYh4

Obrigado!
Andre

--
messages: 337508
nosy: aod
priority: normal
severity: normal
status: open
title: ABC: We ask U.S. news media to interview Human Rights expert Alfred de 
Zayas about Venezuela.

___
Python tracker 

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



[issue36242] spam

2019-03-08 Thread SilentGhost


Change by SilentGhost :


--
nosy:  -aod
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: ABC: We ask U.S. news media to interview Human Rights expert Alfred de 
Zayas about Venezuela. -> spam

___
Python tracker 

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



[issue36242] spam

2019-03-08 Thread SilentGhost


Change by SilentGhost :


--
Removed message: https://bugs.python.org/msg337508

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Jason: StackExchange does have lots of good hints, but it's not always
the correct. In this case, it's clearly wrong. uname -p has been
available on many Unix installations for decades.

I started writing the module back in 1999 and even then, the support
was already working on the systems I used at the time, and several
others, as you can see from this page:

https://www.egenix.com/www2002/python/mxCGIPython.html

The module was originally created to come up with a good name to
use for identifying platform binaries coming out of my mxCGIPython
project.

Note that the processor is not always needed to determine whether
software runs on a machine or not. The "uname -m" output often
is enough, but there are cases where e.g. compiler options are
used which produces code that only works on particular processors.

Perhaps adding a more capable API to interface to /proc/cpuinfo
would be a good idea.

--

___
Python tracker 

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



[issue36241] MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"

2019-03-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue12851] ctypes: getbuffer() never provides strides

2019-03-08 Thread SilentGhost


Change by SilentGhost :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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



[issue36241] MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"

2019-03-08 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The download page linked doesn't contain checksum 
2fe86194bb4027be75b29852027f1a79. The checksum in the page is 
2841e92ba89a6f036305a8a07fbe9d18 and I can confirm that the downloaded binary 
also has the correct checksum as below : 

karthi@ubuntu-s-1vcpu-1gb-blr1-01:~$ wget 
https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi
karthi@ubuntu-s-1vcpu-1gb-blr1-01:~$ md5sum python-2.7.16.amd64.msi
2841e92ba89a6f036305a8a07fbe9d18  python-2.7.16.amd64.msi

>From https://www.python.org/downloads/release/python-2716/

> Windows x86-64 MSI installer Windows for AMD64/EM64T/x64 
> 2841e92ba89a6f036305a8a07fbe9d18 20348928 SIG

--
nosy: +steve.dower, xtreak

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> the output of platform.uname() needs to stay compatible to what the function 
> returned prior

Do we really wish to retain the output for this unreliable interface, 
especially when it is not standardized and is returning improper information? 
Is it valuable for `platform.processor()` to return "i386" (a 34-year-old 
processor) for my 2017 Macbook Pro?

Does maintaining compatibility for `platform.uname()` also imply that 
`platform.processor()` needs to return `platform.uname().processor`, or could 
the interface on the latter change, to provide a more useful value, while 
retaining the behavior of `platform.uname()`?

My instinct is it's impractical to attempt to maintain all of these forks of 
"uname -p", especially when the result is a largely unpredictable value, so I'm 
considering the only other viable option I can conceive now:

 - retain the subprocess call to "uname", but bind it late, as a 
functools.cached_property, such that "uname -p" is only ever called when the 
processor property is requested. This approach would also require overriding 
__iter__ and __getitem__ to retain the namedtuple interface while having that 
element resolved late.

I was also considering this: instead of invoking "uname" anywhere on the path, 
invoke it from an explicit whitelist of paths, such as /bin and /usr/bin, so 
that it's never self-referential. Unfortunately, that wouldn't work if a 
Python-based implementation were put on one of those paths, so it would be 
brittle at best.

Marc-Andre, I'd love your feedback in light of these challenges.

--

___
Python tracker 

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



[issue36241] MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"

2019-03-08 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

When I visit the provided link, I also see what OP describes.

Is it a caching/location issue?  I'm in US-Colorado.

--
nosy: +jkloth

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> Perhaps adding a more capable API to interface to /proc/cpuinfo
would be a good idea.

The core concern I want to address is that it's not possible to use any 
function in the platform module without invoking "uname -p", and thus it's not 
possible to implement "uname" in Python. No amount of supplementary interfaces 
will help with that.

--

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Maybe the best solution is to add functions floor and ceil to cmath module

You say "solution", but what problem would this be a solution to? So far, I 
don't think there's a demonstrated need to have this functionality. What is it 
useful for?

So IMO, the best solution is to make no change: there isn't an actual problem 
to be solved here. :-)

Again: what's the use-case?

--

___
Python tracker 

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



[issue36241] MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"

2019-03-08 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Strange, when I visit the link again in new tab then it gives me the checksum 
as described by OP. But I still have the old tab open with which I wrote my 
comment that has 2841e92ba89a6f036305a8a07fbe9d18 (20348928 bytes) and wget at 
the time also had this checksum as in my comment. I am in India.

--

___
Python tracker 

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



[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander


New submission from Geoff Alexander :

I have the following code:

```
def handle_empty_directories(dir):
if os.path.exists(dir):
shouter.shout("%s exists" % dir)
else:
   shouter.shout("%s doesn't exists" % dir)
entries = os.listdir(dir)
if entries == []:
open(os.path.join(dir, Commiter.hed_file), "w").close()
else:
if (len(entries) > 1) and (Commiter.hed_file in entries):
os.remove(os.path.join(dir, Commiter.hed_file))
for entry in entries:
if entry not in Commiter.hed_ignore:
full_entry = os.path.join(dir, entry)
if (os.path.isdir(full_entry)):
Commiter.handle_empty_directories(full_entry)
```

Occasionally, the call to os.listdir(dir) fails with FileNotFoundError even 
though the os.path.exists(dir) call says that exists:

```
08:57:56 - 
C:\r2g-wd\sport-6.0.5\SBS\SBS\Light\bin\com\ibm\ArtifactTechnology\ABS\ArtifactBroker
 exists
Traceback (most recent call last):
  File "migration.py", line 169, in 
migrate()
  File "migration.py", line 80, in migrate

rtc.acceptchangesintoworkspace(rtc.getchangeentriestoaccept(changeentries, 
history))
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\rtcFunctions.py",
 line 304, in acceptchangesintoworkspace
Commiter.handle_empty_directories(os.getcwd())
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\gitFunctions.py",
 line 126, in handle_empty_directories
Commiter.handle_empty_directories(full_entry)
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\gitFunctions.py",
 line 126, in handle_empty_directories
Commiter.handle_empty_directories(full_entry)
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\gitFunctions.py",
 line 126, in handle_empty_directories
Commiter.handle_empty_directories(full_entry)
  [Previous line repeated 6 more times]
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\gitFunctions.py",
 line 116, in handle_empty_directories
entries = os.listdir(dir)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 
'C:\\r2g-wd\\sport-6.0.5\\SBS\\SBS\\Light\\bin\\com\\ibm\\ArtifactTechnology\\ABS\\ArtifactBroker'
```

I've also seen a similar FileNoteFound on the 

```
open(os.path.join(dir, Commiter.hed_file), "w").close()
```

line when os.path.exists(dir) says that the directory exists.

How can this happen? I'm running Python 3.7.2 64-bit on Windows 10.

--
components: Windows
messages: 337516
nosy: Geoff.Alexander, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python os.listdir fails with FileNotFoundError when directory exists
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



[issue35967] Better platform.processor support

2019-03-08 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 08.03.2019 18:00, Jason R. Coombs wrote:
> 
>> Perhaps adding a more capable API to interface to /proc/cpuinfo
> would be a good idea.
> 
> The core concern I want to address is that it's not possible to use any 
> function in the platform module without invoking "uname -p", and thus it's 
> not possible to implement "uname" in Python. No amount of supplementary 
> interfaces will help with that.

I don't know where you get that idea from. The uname family of APIs
do use "uname -p" on platforms where this exists, but the other
ones don't.

It's also easy to bypass that by simply seeding the global cache
for uname(): _uname_cache. Or you could call your utility
something else. Or you could monkey-patch the platform module
in your utility to work around the circular reference.

To be clear: I do not consider your use case to be particularly common
enough to warrant changes to the module, but would welcome additions
which bring more or better functionality to the module, e.g. having
the processor variable return meaningful where it previously did
not (ie. uname() return '' for the processor entry), or adding
another API to provide more detailed information.

--

___
Python tracker 

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



[issue36224] Python quit unexpectedly error

2019-03-08 Thread Xin Wang


New submission from Xin Wang :

I face the same error with https://bugs.python.org/issue36154, but the solution 
is not work for me. So I want to show you my error.

I'm on a Mac running Mojave, version 10.14.3. I installed Python 3.7.2.
I am using vscode. It is work fine in command line.

Process:   Python [6855]
Path:  
/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier:Python
Version:   3.7.2 (3.7.2)
Code Type: X86-64 (Native)
Parent Process:Microsoft.Python.LanguageServer [6775]
Responsible:   Python [6855]
User ID:   501

Date/Time: 2019-03-07 20:56:29.311 +0800
OS Version:Mac OS X 10.14.3 (18D109)
Report Version:12
Bridge OS Version: 3.3 (16P3133)
Anonymous UUID:9BB7B8DF-31FF-DE9B-C98A-12906B656226

Sleep/Wake UUID:   ACC9C63D-DFE1-42FE-8E68-5C3942745A62

Time Awake Since Boot: 3000 seconds
Time Since Wake:   1000 seconds

System Integrity Protection: enabled

Crashed Thread:0  Dispatch queue: com.apple.main-thread

Exception Type:EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:   KERN_INVALID_ADDRESS at 0x
Exception Note:EXC_CORPSE_NOTIFY

Termination Signal:Segmentation fault: 11
Termination Reason:Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [6855]

VM Regions Near 0:
--> 
__TEXT 00010354-000103542000 [8K] r-x/rwx 
SM=COW  
/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   algos.cpython-37m-darwin.so 0x0001132d2520 
__pyx_pf_6pandas_5_libs_5algos_600__defaults__ + 32
1   algos.cpython-37m-darwin.so 0x000113422ed0 
__Pyx_CyFunction_get_kwdefaults + 48
2   org.python.python   0x00010356655c getset_get + 58
3   org.python.python   0x00010358db50 
_PyObject_GenericGetAttrWithDict + 181
4   org.python.python   0x00010358da40 _PyObject_LookupAttr 
+ 166
5   org.python.python   0x0001035eb1c4 builtin_getattr + 141
6   org.python.python   0x000103561637 
_PyMethodDef_RawFastCallKeywords + 496
7   org.python.python   0x000103560bd3 
_PyCFunction_FastCallKeywords + 44
8   org.python.python   0x0001035f65f0 call_function + 636
9   org.python.python   0x0001035ef2cf 
_PyEval_EvalFrameDefault + 7174
10  org.python.python   0x000103560fae 
function_code_fastcall + 112
11  org.python.python   0x0001035f6665 call_function + 753
12  org.python.python   0x0001035ef2cf 
_PyEval_EvalFrameDefault + 7174
13  org.python.python   0x0001035f6ef7 
_PyEval_EvalCodeWithName + 1835
14  org.python.python   0x000103560b98 
_PyFunction_FastCallKeywords + 225
15  org.python.python   0x0001035f6665 call_function + 753
16  org.python.python   0x0001035ef375 
_PyEval_EvalFrameDefault + 7340
17  org.python.python   0x000103560fae 
function_code_fastcall + 112
18  org.python.python   0x0001035f6665 call_function + 753
19  org.python.python   0x0001035ef2cf 
_PyEval_EvalFrameDefault + 7174
20  org.python.python   0x0001035f6ef7 
_PyEval_EvalCodeWithName + 1835
21  org.python.python   0x000103560b98 
_PyFunction_FastCallKeywords + 225
22  org.python.python   0x0001035f6665 call_function + 753
23  org.python.python   0x0001035ef218 
_PyEval_EvalFrameDefault + 6991
24  org.python.python   0x0001035f6ef7 
_PyEval_EvalCodeWithName + 1835
25  org.python.python   0x000103560801 
_PyFunction_FastCallDict + 441
26  org.python.python   0x000103561931 
_PyObject_Call_Prepend + 150
27  org.python.python   0x00010359f05c slot_tp_init + 80
28  org.python.python   0x00010359bd28 type_call + 178
29  org.python.python   0x000103560a39 
_PyObject_FastCallKeywords + 359
30  org.python.python   0x0001035f665e call_function + 746
31  org.python.python   0x0001035ef375 
_PyEval_EvalFrameDefault + 7340
32  org.python.python   0x0001035f6ef7 
_PyEval_EvalCodeWithName + 1835
33  org.python.python   0x000103560801 
_PyFunction_FastCallDict + 441
34  org.python.python   0x000103561931 
_PyObject_Call_Prepend + 150
35  org.python.python   0x00010359f05c slot_tp_init + 80
36  org.python.python   0x00010359bd28 ty

[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

In [this 
commit](https://github.com/jaraco/cpython/commit/acd024e2d4aa56f13d7bc165d10a35510e83a12b),
 I demonstrate the alternative approach I was considering that avoids calling 
"uname -p" until it's required, but otherwise retains compatibility by using 
the same logic for resolving the processor on the various platforms.

--

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> It's also easy to bypass that by simply seeding the global cache
> for uname(): _uname_cache. 
> Or you could monkey-patch the platform module
> in your utility to work around the circular reference.

I don't think these options are possible in the general case. It was what I 
attempted to do in the first place, but could not. Consider the situation where 
a namespace package is present or where a script uses pkg_resources to 
bootstrap itself (a very common case), or any other case where 
`platform.(anything)` is invoked before the "bypass" or "monkey-patch" has a 
chance to run. This happens when running the test suite for `cmdix` because 
pytest invokes pkg_resources to search for entry points and that code invokes 
`platform.system` (or similar) to evaluate environment markers long before the 
cmdix code has been imported.

Here's what happens:

`platform.(anything)` runs `platform.uname` and `platform.uname` invokes `uname 
-p` in a subprocess _unconditionally_. Python doesn't provide hooks to 
monkey-patch that out before it gets invoked.

> Or you could call your utility something else.

The point of this utility is to supply "coreutils" using Python. It's derived 
from an abandoned project called "pycoreutils", one purpose of which is to 
provide the core utilities on a minimal Linux distribution that doesn't have 
uname. Another is to supply coreutils on Windows. Having an alternate name 
isn't really viable when the purpose is to supply that interface.


I do think your considerations are reasonable, and I'm close to giving up. I 
look forward to your feedback on the 'resolved-late' branch.

--

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-08 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +12227

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+0 

I support making this change, if only to keep the quoting convention consistent 
with how we quote attributes.  Also, use of double quotes seems to be the norm. 
 I made a brief informal survey of XML samples from multiple sources including 
DocBook, MS Excel, RSS feeds, the W3Schools examples, and various XML tutorials 
-- the only exception to double quotes was a NOAA weather feed.  The XML spec 
itself shows a preference for double quotes in its examples.

--
nosy: +rhettinger

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-08 Thread Марат Нагаев

Марат Нагаев  added the comment:

I think at bank.
I find post (Russian) about complex numbers:
https://cyberleninka.ru/article/v/primenenie-kompleksnyh-chisel-v-finansovyh-operatsiyah
And rounding was used.
Sorry, I don't know about English version of this article.

--

___
Python tracker 

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



[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-08 Thread Geoff Alexander


Geoff Alexander  added the comment:

Using the "\\?\" prefix does not work.  Here's a small example:

```
import os
import subprocess

os.chdir(r"\\?\C:\Users")
output = subprocess.check_output("dir", shell=True)
```

Using Python 3.7.2 64-bit on Windows 10 fails with

```
c:\Users\GeoffAlexander\Documents\Python>python test.py
'\\?\C:\Users'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
```

--

___
Python tracker 

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



[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander


Change by Geoff Alexander :


--
type:  -> behavior

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-03-08 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +12228
stage:  -> patch review

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-08 Thread Tim Peters


Tim Peters  added the comment:

I have no use for this either, and agree with rejecting it - in nearly 30 
years, nobody has asked for this before, and it's still the case that we don't 
have an actual programming use case (some theoretical use in an abstract 
mathematical model isn't a programming use case).  Seems far more likely that 
someone applying floor() or ceil() to a complex number is confused.

math.tau was essentially useless too, but Guido wanted to add it mostly as a 
light-hearted inside joke:

https://bugs.python.org/issue12345

Against that, I see that the popular mpmath Python package does support it (for 
floor and ceil).  Perhaps you could get mpmath's author to chime in here with a 
"good" argument for adding it to the core language?

http://mpmath.org/doc/current/general.html#floor

"""
The floor function is defined for complex numbers and acts on the real and 
imaginary parts separately:

>>> floor(3.25+4.75j)
mpc(real='3.0', imag='4.0')
"""

--
nosy: +tim.peters

___
Python tracker 

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



[issue35843] importlib.util docs for namespace packages innaccurate

2019-03-08 Thread miss-islington


miss-islington  added the comment:


New changeset ab9b31f94737895f0121f26ba3ad718ebbc24fe1 by Miss Islington (bot) 
(Anthony Sottile) in branch 'master':
bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)
https://github.com/python/cpython/commit/ab9b31f94737895f0121f26ba3ad718ebbc24fe1


--
nosy: +miss-islington

___
Python tracker 

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



[issue35843] importlib.util docs for namespace packages innaccurate

2019-03-08 Thread Brett Cannon


Change by Brett Cannon :


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



[issue36241] MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"

2019-03-08 Thread Steve Dower


Steve Dower  added the comment:

We updated the build to be properly code signed, but the CDN may still be 
caching the old release.

Nothing has changed except the signature on the installer (Python 2 binaries 
have never been signed). I'll run a CDN purge to try and clear it up.

--

___
Python tracker 

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



[issue36241] MD5 checksum is not valid for v2.7.16 "Windows x86-64 MSI installer"

2019-03-08 Thread Steve Dower


Steve Dower  added the comment:

I redownloaded and confirmed that the files are correct.

Benjamin - the MD5 for the 32-bit installer didn't get updated. It should be 
912428345b7e0428544ec4edcdf70286 (as in my updated email I sent).

--

___
Python tracker 

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



[issue36244] Lock release fails under windows

2019-03-08 Thread Konrad Ciecierski


New submission from Konrad Ciecierski :

In python 3.7.2 when the subprocess releases the acquired lock, 
the OSError occurs: "OSError: [WinError 6] The handle is invalid".
Problem does not occur under Ubuntu 18.

  File "multip-test.py", line 13, in worker
lock.release()
OSError: [WinError 6] The handle is invalid

--
components: Interpreter Core, Windows
files: multip-test.py
messages: 337527
nosy: Konrad Ciecierski, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Lock release fails under windows
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48198/multip-test.py

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Stefan Behnel


Stefan Behnel  added the comment:

While I do understand the interest in a bit more visual consistency (and, 
lacking further input, I assume that this is the OP's "problem"), it really is 
at best a purely visual improvement with the potential to break code and/or 
tests out there. I'd rather not make that change.

FWIW, lxml also uses single quotes in the XML declaration (originally following 
ElementTree), but double quotes by default for the rest, except for attributes 
that contain double quotes (but no single quotes). Any XML parser in the world 
is able to deal with that (since otherwise, it's not an XML parser). Nothing is 
broken here.

--

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-08 Thread Fredrik Johansson


Fredrik Johansson  added the comment:

I can think of two reasons to extend floor() and ceil() to complex numbers, and 
they lead to different extensions.

The first is as a way to map complex numbers to nearby Gaussian integers by 
defining floor(z) = floor(z.real) + floor(z.imag)*1j, etc. Definition in mpmath 
borrowed from Mathematica. Conceivably handy for data quantization, or discrete 
plane geometry... but I honestly never used it myself and can't remember ever 
seeing it used.

The second is to extend piecewise analytic functions on R to piecewise 
holomorphic functions on C so that the real analytic segments extend to complex 
analytic neighborhoods, most easily achieved by defining floor(z) = 
floor(z.real). This one I've actually had use for (think complex step 
differentiation, contour integration), but it's a bit esoteric.

My opinion? If a Python user calls floor() and ceil() with a complex input, 
it's probably because of a bug in their code, and TypeError is appropriate. 
It's a one-line lambda to define your own complex extension if you really need 
it.

On the other hand: if it exists, someone will eventually find a way to use it 
for code golf ;-)

--
nosy: +fredrikj

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-08 Thread Jess


New submission from Jess :

Have a fix for this that I'll send off shortly.

What I see with the current head (my username was replaced with "Foo Bar" in 
this example:
> Using "C:\Users\Foo 
> Bar\cpython\PCbuild\\..\externals\pythonx86\tools\python.exe" (found in 
> externals directory)
> Bar\cpython\PCbuild\\..\externals\pythonx86\tools\python.exe""=="" was 
> unexpected at this time.

My theory, window's turning:
> C:\Users\Foo Bar
into
> "C:\Users\Foo Bar"
and this is colliding with our use of "%PYTHON%", creating double quotes, or:
> ""C:\Users\Foo Bar""
which, of course:
> if ""C:\Users\Foo Bar""==""
does not make sense as a statement.

--
components: Windows
messages: 337530
nosy: Jess, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: PCBuild/build.bat errors, probably from space characters in paths
type: compile error

___
Python tracker 

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



  1   2   >