[issue38024] adding or subtracting decimals

2019-09-04 Thread QA.Nathaniel Logarta


New submission from QA.Nathaniel Logarta 
:

Just try to add decimals
It doesn't have any trigger on my end
As long as it is a complex decimal or adding decimal zeroes to non-zero

--
components: Windows
files: adding or subtracting decimals.PNG
messages: 351117
nosy: QA.Nathaniel Logarta, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: adding or subtracting decimals
versions: Python 3.7
Added file: https://bugs.python.org/file48590/adding or subtracting decimals.PNG

___
Python tracker 

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



[issue38024] adding or subtracting decimals

2019-09-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Please include the text of the repl session in issue so that it would be easy 
to copy past and also more accessible. The issue is as below in the attached 
image. I guess this is due to floating point representation and has some 
possible solutions in this page : 
https://docs.python.org/3/tutorial/floatingpoint.html and 
https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate

$ python3
Python 3.8.0b4 (v3.8.0b4:d93605de72, Aug 29 2019, 21:47:47)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 17.5 + 6169.90760
6186.90764999
>>> from decimal import Decimal
>>> Decimal('17.5') + Decimal('6169.90760')
Decimal('6186.90765')

--
nosy: +xtreak

___
Python tracker 

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



[issue38024] adding or subtracting decimals

2019-09-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-04 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue38025] format

2019-09-04 Thread Daniel Futterweit


Change by Daniel Futterweit :


--
nosy: Daniel_Python
priority: normal
severity: normal
status: open
title: format
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue38025] format

2019-09-04 Thread Daniel Futterweit


New submission from Daniel Futterweit :

f'{10001323121:,.0f}'
returns:
'10,000,000,000,000,001,761,595,319,084,122,112'

f'{10001323121:,}'
returns:
'10,000,000,000,000,001,323,120,000,000,000,001'

--

___
Python tracker 

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



[issue38025] format

2019-09-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

When you convert the integer to a float (because of the 'f' in the first format 
spec), you're losing precision. See:

https://docs.python.org/3/tutorial/floatingpoint.html and 
https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread Inada Naoki


New submission from Inada Naoki :

Reported here: 
https://github.com/python/cpython/commit/feaefc7f60cd3be7bf4ecc2b73e77d2bfe048403

I merged GH-5351 but it broke inspect.getattr_static behavior.  It should be 
reverted.

--
components: Library (Lib)
keywords: 3.8regression
messages: 351121
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: inspect.getattr_static should avoid dynamic lookup
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread Inada Naoki


Change by Inada Naoki :


--
keywords: +patch
pull_requests: +15336
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15676

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

The main blocker issue (if we decide to accept this feature) is the pickle 
serialization issue.


Serhiy Storchaka:
> No, it is not fully backwards-compatible. First, if pickle a namedtuple, it 
> can't be unpickled in previous versions.

Would it be possible to tell pickle to serialize .isocalendar() as a tuple, and 
deserialize it from a tuple to a structseq? I'm thinking at __getstate__ and 
__setstate__ methods, but I'm not sure how to use them.


Serhiy Storchaka:
> Second, namedtuple is slower and larger than tuple, so it shouldn't be used 
> in memory or performance critical code.

vstinner@apu$ python3
Python 3.7.4 (default, Jul  9 2019, 16:32:37) 
>>> import sys
>>> s=sys.version_info
>>> t=tuple(s)
>>> sys.getsizeof(t), sys.getsizeof(s)
(96, 96)
>>> type(s)


Hum, structseq and tuple seem to have exactly the same memory footprint: only 
the type is larger, not instances.

According to msg350986, the performance to instanciate a new object is exactly 
the same between tuple and structseq.

--

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ana


New submission from Ana :

So, all in all, if I try to install Numpy, SciPy, pandas or any related 
libraries via pip I see several issues, no AIX version written (somewhere?) for 
Python 3.8, as well as pip addresses to mkl_rt, which is not found in the path.

I am trying to use python3.8 as a system interpreter and pip version: pip 
19.2.3 I don't want to use conda. I am trying to test it using my system. What 
can I do?

--
components: macOS
messages: 351123
nosy: annelischen, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda
type: crash
versions: Python 3.8

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

What issues to you see?

What operating system and version are you on?

How did you install Python?

Note that Python 3.8 is still in beta and therefore a lot of 3th party 
libraries do no yet have binary wheels available. You therefore likely need a 
compiler to install Numpy and related libraries.

--

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ana

Ana  added the comment:

1) The OS: Mojave 10.14.6
2) Python is currently here: /usr/local/bin/python
3)Pip is here: /usr/local/bin/pip Here is pip -V: pip 19.2.3 from 
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip
 (python 3.8)
4)I know it’s in beta, but I am trying to report the issues, which I find wrong
5) pip install  doesn’t work
6) If I install manually, I can install the libs:
$ pip download 
$ cd somewhat
$ python setup.py build
$ python setup.py install

And in that case everything works, I can see the libs installed in my PyCharm 
app as well.

And I can run simple code in PyCharm with given Python and Pip, if I install 
the libs manually.

However, everything must work with just pip install , that’s why I am 
reporting.

Thx

> On 4 Sep 2019, at 15:49, Ronald Oussoren  wrote:
> 
> 
> Ronald Oussoren  added the comment:
> 
> What issues to you see?
> 
> What operating system and version are you on?
> 
> How did you install Python?
> 
> Note that Python 3.8 is still in beta and therefore a lot of 3th party 
> libraries do no yet have binary wheels available. You therefore likely need a 
> compiler to install Numpy and related libraries.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-09-04 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

Here is my first pass at this. I propose the following sentence be added at the 
end section 8.4:

If you need to track related exceptions (exceptions during exception handling), 
you should use exception chaining. You can chain exceptions by using the 
``from`` clause. Just raise a new exception class or instance from an existing 
exception. The existing exception will be set as 
the cause for the new exception.

--

___
Python tracker 

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



[issue37966] is_normalized is much slower at "no" than the standard's algorithm

2019-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Greg Price for this nice optimization!

--

___
Python tracker 

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



[issue36030] add internal API function to create tuple without items array initialization

2019-09-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 60bd1f88f21073965a444c8b39c4202d015da5d6 by Victor Stinner 
(Zackery Spytz) in branch 'master':
bpo-36030: Fix a possible segfault in PyTuple_New() (GH-15670)
https://github.com/python/cpython/commit/60bd1f88f21073965a444c8b39c4202d015da5d6


--

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Thanks for the update.

What's the error message you get when using pip to install?

--

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ana


Ana  added the comment:

That's huge, so I am attaching it in a separate file

--
Added file: https://bugs.python.org/file48591/piperroroutput.txt

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

There are known Cython-related issues with the latest NumPy *release* and 
Python 3.8, due to a signature change in PyCode_New. But those issues are 
already fixed in NumPy master. `pip install numpy` fails for me in a Python 
3.8b4 venv, but `pip install git+https://github.com/numpy/numpy.git` works.

But none of this indicates a bug in core Python, as far as I know.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

I forgot to include the NumPy issue link: 
https://github.com/numpy/numpy/issues/14403 (and other similar issues).

The pip error output you posted looks like the same issue to me.

--

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ana


Ana  added the comment:

At the end of each error log, there is a message stating different python 
versions (up to 3.7) and AIX. However, there is no python3.8 + AIX, and there 
is no corresponding dependency:

ERROR: Command errored out with exit status 2:
   command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip
 install --ignore-installed --no-user --prefix 
/private/tmp/pip-build-env-4mykinsd/overlay --no-warn-script-location 
--no-binary :none: --only-binary :none: -i https://pypi.org/simple 
 -- wheel setuptools 'Cython>=0.29.2' 'numpy==1.13.3; 
python_version=='"'"'3.5'"'"' and platform_system!='"'"'AIX'"'"'' 
'numpy==1.13.3; python_version=='"'"'3.6'"'"' and 
platform_system!='"'"'AIX'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"' 
and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; 
python_version=='"'"'3.5'"'"' and platform_system=='"'"'AIX'"'"'' 
'numpy==1.16.0; python_version=='"'"'3.6'"'"' and 
platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"' 
and platform_system=='"'"'AIX'"'"''
   cwd: None

> On 4 Sep 2019, at 17:09, Mark Dickinson  wrote:
> 
> pip install git+https://github.com/numpy/numpy.git 
> https://github.com/numpy/numpy.git%60>

--

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ana

Ana  added the comment:

Thx for the link. Btw, I have tried: pip install 
git+https://github.com/numpy/numpy.git https://github.com/numpy/numpy.git> 
That doesn’t work for me. The only way I can install somewhat is downloading 
the package, building and installing it.

> On 4 Sep 2019, at 17:11, Mark Dickinson  wrote:
> 
> 
> Mark Dickinson  added the comment:
> 
> I forgot to include the NumPy issue link: 
> https://github.com/numpy/numpy/issues/14403 (and other similar issues).
> 
> The pip error output you posted looks like the same issue to me.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2019-09-04 Thread Zachary Ware


Zachary Ware  added the comment:

>I don't understand why we'd have scheme and netloc, but nothing for path and 
>query.

I'm not sure what you mean here; can you please clarify?

> What are you suggesting we add for scheme/allow_fragements?

Just a brief description of what effect the arguments actually have on the 
returned result.

--

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Ana,

The error in "piperroroutput.txt" points to the issue Mark mentioned in 
msg351131: the current release of Numpy is not compatible with Python 3.8, but 
the tip of the tree on GitHub is.

I can install Numpy from the repository:

$ python --version
Python 3.8.0b4

$ pip install git+https://github.com/numpy/numpy.git
Collecting git+https://github.com/numpy/numpy.git
  Cloning https://github.com/numpy/numpy.git to 
/private/var/folders/dy/5fl45b9s61x84g7k_18618vcgn/T/pip-req-build-b3_tnmd0
  Running command git clone -q https://github.com/numpy/numpy.git 
/private/var/folders/dy/5fl45b9s61x84g7k_18618vcgn/T/pip-req-build-b3_tnmd0
  Running command git submodule update --init --recursive -q
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517) ... done
  Created wheel for numpy: 
filename=numpy-1.18.0.dev0+3883be3-cp38-cp38-macosx_10_9_x86_64.whl 
size=4534619 
sha256=005a0085f7dcca60b138b0ed01c72977fa0777e4ef1e0693a84295b663ef1178
  Stored in directory: 
/private/var/folders/dy/5fl45b9s61x84g7k_18618vcgn/T/pip-ephem-wheel-cache-f8wuhnns/wheels/08/c9/f0/5fb73d652a67220580b707eb5b66bfcccf521160a016ae6f2e
Successfully built numpy
Installing collected packages: numpy
Successfully installed numpy-1.18.0.dev0+3883be3

I propose closing this issue as a 3th-party issue. This should resolve itself 
with the next release of Numpy.

--
resolution:  -> third party
status: open -> pending

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2019-09-04 Thread sushma


sushma  added the comment:

I guess what I'm wondering is this: 

urlsplit(url, scheme='', allow_fragments=True)
Parse a URL into 5 components:
:///?#
Return a 5-tuple: (scheme, netloc, path, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) and we don't expand % escapes.
(END)

We don't have details regarding anything, i.e scheme, netloc, path or query or 
fragments. So I was curious about why we would have more documentation around 
netloc and scheme and nothing about path and query

Should we be adding information for all(scheme, netloc, path, query, fragment) 
of them, including extra attributes of the returned SplitResult? 

p.s - newbie trying to contribute here

--

___
Python tracker 

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



[issue38027] Can't use Numpy, SciPy, pandas in Python3.8.0b4 without conda

2019-09-04 Thread Ned Deily


Change by Ned Deily :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-09-04 Thread Ned Deily


Change by Ned Deily :


--
nosy: +barry, maxking, r.david.murray

___
Python tracker 

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



[issue35923] Update the BuiltinImporter in importlib to use loader._ORIGIN instead of a hardcoded value

2019-09-04 Thread Ned Deily


Change by Ned Deily :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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



[issue38028] Assertion error in Python 3.8

2019-09-04 Thread Ana


New submission from Ana :

After all, I am trying to install the dev version of Numpy and the other libs. 
Unfortunately, I am still unable to install them. I have some assertion errors:

ERROR: Exception:
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/cli/base_command.py",
 line 188, in main
status = self.run(options, args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/commands/install.py",
 line 398, in run
installed = install_given_reqs(
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/req/__init__.py",
 line 54, in install_given_reqs
requirement.install(
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/req/req_install.py",
 line 925, in install
self.move_wheel_files(
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/req/req_install.py",
 line 453, in move_wheel_files
wheel.move_wheel_files(
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/wheel.py",
 line 324, in move_wheel_files
scheme = distutils_scheme(
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/locations.py",
 line 104, in distutils_scheme
assert not (home and prefix), "home={} prefix={}".format(home, prefix)
AssertionError: home=/private/tmp/pip-target-4p5evqc_ 
prefix=/private/tmp/pip-build-env-b27ru_1v/overlay

That's the first time I see such an issue and googling doesn't resolve it at all

--
components: macOS
messages: 351138
nosy: annelischen, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Assertion error in Python 3.8
type: crash
versions: Python 3.8

___
Python tracker 

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



[issue38028] Assertion error in Python 3.8

2019-09-04 Thread Steve Dower


Change by Steve Dower :


--
nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore, pradyunsg

___
Python tracker 

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



[issue38029] Should io.TextIOWrapper raise an error at instantiation if a StringIO is passed as 'buffer'?

2019-09-04 Thread Brian Skinn


New submission from Brian Skinn :

If I read the docs correctly, io.TextIOWrapper is meant to provide a str-typed 
interface to an underlying bytes stream.

If a TextIOWrapper is instantiated with the underlying buffer=io.StringIO(), it 
breaks:

>>> import io
>>> tw = io.TextIOWrapper(io.StringIO())
>>> tw.write(b'abcd\n')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: write() argument must be str, not bytes
>>> tw.write('abcd\n')
5
>>> tw.read()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: string argument expected, got 'bytes'
>>> tw.read(1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: underlying read() should have returned a bytes-like object, not 'str'



Would it be better for TextIOWrapper to fail earlier, at instantiation-time, 
for this kind of (unrecoverably?) broken type mismatch?

--
components: Library (Lib)
messages: 351139
nosy: bskinn
priority: normal
severity: normal
status: open
title: Should io.TextIOWrapper raise an error at instantiation if a StringIO is 
passed as 'buffer'?
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue38028] Assertion error in Python 3.8

2019-09-04 Thread Ned Deily


Ned Deily  added the comment:

NumPy has a very complex build and install process including supplying its own 
modified version of Distutils.  You should take up any build and install issues 
first with the NumPy project and then, if you both agree that there appears to 
be a problem in Python itself, re-open an issue here.  We really are not in a 
position to debug NumPy installs here.

--
resolution:  -> third party
stage:  -> resolved
type: crash -> 

___
Python tracker 

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



[issue38028] Assertion error in Python 3.8

2019-09-04 Thread Ana

Ana  added the comment:

Well I have been looking through the interim commands running by the terminal. 
As far as I can see that’s not Numpy/scipy or whatever.

These are the setup tools, wheel and Cython. I may be wrong, but I guess these 
are pretty universal and are required by many functionalities of Python

sudo -H /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip
 install --ignore-installed --no-user --prefix 
/private/tmp/pip-build-env-b27ru_1v/overlay --no-warn-script-location 
--no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 
setuptools wheel cython
Password:
Collecting setuptools
  Using cached 
https://files.pythonhosted.org/packages/b2/86/095d2f7829badc207c893dd4ac767e871f6cd547145df797ea26baea4e2e/setuptools-41.2.0-py2.py3-none-any.whl
Collecting wheel
  Using cached 
https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Collecting cython
Installing collected packages: setuptools, wheel, cython

The error appeared right after running that command. So, is it still a Numpy 
issue?

> On 4 Sep 2019, at 19:10, Ned Deily  wrote:
> 
> 
> Ned Deily  added the comment:
> 
> NumPy has a very complex build and install process including supplying its 
> own modified version of Distutils.  You should take up any build and install 
> issues first with the NumPy project and then, if you both agree that there 
> appears to be a problem in Python itself, re-open an issue here.  We really 
> are not in a position to debug NumPy installs here.
> 
> --
> resolution:  -> third party
> stage:  -> resolved
> type: crash -> 
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue9938] Add optional kwargs to argparse

2019-09-04 Thread hai shi


Change by hai shi :


--
nosy: +rhettinger

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-09-04 Thread Michael Felt


Michael Felt  added the comment:

Thank you Ned.

Not a justification perhaps, but a way to specify that it is support. Three+ 
years ago when I first worked on something for Lib/ctypes to get find_library() 
et al working for AIX I was also asked to add it as _aix.py similar to the 
macos support (with, iirc is more than just a single file) being separate from 
util.py. 

To me, it just seemed that is the way it is done to keep maintenance of the 
core (external) code cleaner. 

After I post the PR I welcome your perspective on the sense or nonsense of 
having a separate _xxx_support.py file (where _xxx could be any platform, not 
merely osx or aix.

--

___
Python tracker 

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



[issue37245] Azure Pipeline 3.8 CI: multiple tests hung and timed out on macOS 10.13

2019-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm still seeing this, maybe 1 in 20 builds, so it's semi-random. A new 
> deadlock, maybe?

It seems like only the jobs on Azure are killed by timeout. The jobs on macOS 
buildbots look fine. Maybe macOS on Azure is running slower and we should just 
increase the timeout?

The bug still occurs:

https://github.com/python/cpython/pull/15651
https://dev.azure.com/Python/cpython/_build/results?buildId=49786&view=results

0:49:27 load avg: 1.41 [419/419/6] test_threading crashed (Exit code 1)

6 tests failed:
test_concurrent_futures test_functools test_importlib
test_multiprocessing_forkserver test_multiprocessing_spawn
test_threading

The whole job was killed after 57 minutes.

--

___
Python tracker 

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



[issue38028] Assertion error in Python 3.8

2019-09-04 Thread Ned Deily


Ned Deily  added the comment:

The traceback you provide in the first message:

  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/wheel.py",
 line 324, in move_wheel_files
scheme = distutils_scheme(
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/locations.py",
 line 104, in distutils_scheme
assert not (home and prefix), "home={} prefix={}".format(home, prefix)
AssertionError: home=/private/tmp/pip-target-4p5evqc_ 
prefix=/private/tmp/pip-build-env-b27ru_1v/overlay

shows a reference to a Distutils data structure.  As I noted above, NumPy has 
(or at least it used to have) its own customized version of Distutils.  So that 
seems quite likely to be due to some incompatibility between the two versions 
of Distutil. 

And, in any case, if it were to be determined that there is a problem with pip 
or setuptools or cython, each of those projects has its own issue tracker.  
Again, you should start with the NumPy project since they are the ones who make 
all these pieces work together by providing NumPy's build and installation 
scripts.

--
status: open -> closed

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2019-09-04 Thread Zachary Ware


Zachary Ware  added the comment:

I see.  I don't think we need to describe each returned component in the 
docstring; they're some combination of self-explanatory, described in the 
reference docs, or just industry-standard terms that are easily defined from 
other sources.  I'm not suggesting to add anything to the docstring about the 
`scheme` return component, but rather the *scheme* argument (which is the 
default value for the `scheme` return component when it's not found in the 
*url*).  The subcomponents of netloc should be mentioned because the docstring 
currently gives the impression that the user has to parse them out for 
themselves, which is not true.

Off the top of my head, I'd suggest changing the `urlsplit` docstring to 
something like:

```
Parse *url* and return a SplitResult.

SplitResult is a named 5-tuple of the following components:
:///?#

The ``username``, ``password``, ``hostname``, and ``port``
sub-components of ``netloc`` can also be accessed as
attributes of the SplitResult object.

The *scheme* argument provides the default value of the
``scheme`` component when no scheme is found in *url*.

If *allow_fragments* is False, no attempt is made to
separate the ``fragment`` component from the previous
component, which can be either ``path`` or ``query``.

Note that % escapes are not expanded.
```

--
nosy: +orsenthil

___
Python tracker 

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



[issue37245] Azure Pipeline 3.8 CI: multiple tests hung and timed out on macOS 10.13

2019-09-04 Thread Steve Dower


Steve Dower  added the comment:

> Maybe macOS on Azure is running slower and we should just increase the 
> timeout?

(Aside, why don't the macOS buildbots have a tag saying that? Took me ages to 
find them...)

I doubt it's running 6-7x slower. More likely something is causing one of the 
workers to crash at a point where the lock remains held instead of being 
released (I saw this at work the other week in a slightly different context, 
but same symptoms).

Could os._exit() at the wrong time cause it?

It also looks like Azure is running tests with 4 processes, but the buildbot 
(at least the one I'm looking at) is only using 2. So perhaps there are more 
conflicts from that?

--

___
Python tracker 

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



[issue37245] Azure Pipeline 3.8 CI: multiple tests hung and timed out on macOS 10.13

2019-09-04 Thread Ned Deily


Ned Deily  added the comment:

Yeah, I agree that increasing the timeout shouldn't be the answer here. I still 
have never seen failure modes like this when running my own tests.  The idea 
about CPUs is one worth pursuing although I usually run with -j3.  Also I 
wonder how much memory the VM is configured with.  Any way we can find out 
number of cpus and memory easily?

--

___
Python tracker 

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



[issue38014] Python 3.7 does not compile

2019-09-04 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-09-04 Thread Michael Felt


Change by Michael Felt :


--
keywords: +patch
pull_requests: +15337
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15678

___
Python tracker 

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



[issue37934] Docs: Clarify NotImplemented use cases

2019-09-04 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> As you say, we currently have only one usage of NotImplemented outside its 
> intended purpose.

I know at least 3 in CPython, so it's not so rare to use NotImplemented for 
something else than binary operators:
1. __subclasshook__
2. reducer_override (in pickling)
3. __length_hint__

> Of course, you might argue that _once Python has NotImplemented_, it can be 
> used elsewhere - but as I said, I don't think it should be encouraged.

I'm not saying that it should be actively encouraged, but the documentation 
shouldn't be limited to just one use case. Given that NotImplemented exists, 
why shouldn't it be used in more cases to indicate that an operation is not 
implemented?

--

___
Python tracker 

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



[issue37858] CookieLib: MozillaCookieJar.py uses case-sensitive regex to validate cookies file

2019-09-04 Thread Ashley Harvey


Change by Ashley Harvey :


--
keywords: +patch
pull_requests: +15338
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15673

___
Python tracker 

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



[issue37858] CookieLib: MozillaCookieJar.py uses case-sensitive regex to validate cookies file

2019-09-04 Thread Ashley Harvey


Change by Ashley Harvey :


--
pull_requests: +15339
pull_request: https://github.com/python/cpython/pull/15679

___
Python tracker 

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



[issue37858] CookieLib: MozillaCookieJar.py uses case-sensitive regex to validate cookies file

2019-09-04 Thread Ashley Harvey


Change by Ashley Harvey :


--
pull_requests: +15340
pull_request: https://github.com/python/cpython/pull/15680

___
Python tracker 

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



[issue38030] os.stat fails for block devices such as //./PhysicalDrive0

2019-09-04 Thread Eryk Sun


New submission from Eryk Sun :

In issue 37834, I posted a suggest implementation of win32_xstat_impl that 
included the following snippet of code:

if (!GetFileInformationByHandle(hFile, &fileInfo)) {
error = GetLastError();
if (error != ERROR_INVALID_PARAMETER &&
error != ERROR_INVALID_FUNCTION &&
error != ERROR_NOT_SUPPORTED) {
retval = -1;
goto cleanup;
}
/* Volumes and physical disks are block devices, e.g.
   \\.\C: and \\.\PhysicalDrive0. */
memset(result, 0, sizeof(*result));
result->st_mode = 0x6000; /* S_IFBLK */
goto cleanup;
}

This is meant to handle the above errors. We know we have FILE_TYPE_DISK. If 
GetFileInformationByHandle fails with one of the above error codes, then we 
must have a disk or volume device without a mounted file-system device. This 
should be reported as a block device.

However it was changed in the final version as follows:

if (!GetFileInformationByHandle(hFile, &fileInfo)) {
switch (GetLastError()) {
case ERROR_INVALID_PARAMETER:
case ERROR_INVALID_FUNCTION:
case ERROR_NOT_SUPPORTED:
retval = -1;
goto cleanup;
}
/* Volumes and physical disks are block devices, e.g.
   \\.\C: and \\.\PhysicalDrive0. */
memset(result, 0, sizeof(*result));
result->st_mode = 0x6000; /* S_IFBLK */
goto cleanup;
}

Now it's failing on the errors that should be handled, and succeeding on all 
other errors that should fail. If we want to use a switch statement here, I 
suggest the following:

if (!GetFileInformationByHandle(hFile, &fileInfo)) {
switch (GetLastError()) {
case ERROR_INVALID_PARAMETER:
case ERROR_INVALID_FUNCTION:
case ERROR_NOT_SUPPORTED:
/* Volumes and physical disks are block devices, e.g.
   \\.\C: and \\.\PhysicalDrive0. */
memset(result, 0, sizeof(*result));
result->st_mode = 0x6000; /* S_IFBLK */
goto cleanup;
}
retval = -1;
goto cleanup;
}

--
components: IO, Windows
messages: 351149
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: high
severity: normal
stage: needs patch
status: open
title: os.stat fails for block devices such as //./PhysicalDrive0
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue38030] os.stat fails for block devices such as //./PhysicalDrive0

2019-09-04 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower

___
Python tracker 

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



[issue37858] CookieLib: MozillaCookieJar.py uses case-sensitive regex to validate cookies file

2019-09-04 Thread Ned Deily


Change by Ned Deily :


--
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue38030] os.stat fails for block devices such as //./PhysicalDrive0

2019-09-04 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +15341
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15681

___
Python tracker 

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



[issue38031] FileIO.__init__ aborts when opener returns bad fd

2019-09-04 Thread Maxwell Bernstein


New submission from Maxwell Bernstein :

On a debug build, the following causes an abort:

import _io
_io.FileIO("foobar", opener=lambda name, flags: 100)

100 is not a valid fd. FileIO attempts to raise an IOError from errno, but 
there is already an exception set when PyErr_SetFromErrno uses PyObject_Call to 
create the exception.

--
components: IO
messages: 351150
nosy: tekknolagi
priority: normal
severity: normal
status: open
title: FileIO.__init__ aborts when opener returns bad fd
type: crash
versions: Python 3.6

___
Python tracker 

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



[issue38030] os.stat fails for block devices such as //./PhysicalDrive0

2019-09-04 Thread Steve Dower


Steve Dower  added the comment:


New changeset 772ec0fad57412daa53d16d7019b6b2fe6e94942 by Steve Dower in branch 
'master':
bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)
https://github.com/python/cpython/commit/772ec0fad57412daa53d16d7019b6b2fe6e94942


--

___
Python tracker 

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



[issue38030] os.stat fails for block devices such as //./PhysicalDrive0

2019-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15342
pull_request: https://github.com/python/cpython/pull/15682

___
Python tracker 

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



[issue38030] os.stat fails for block devices such as //./PhysicalDrive0

2019-09-04 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue38030] os.stat fails for block devices such as //./PhysicalDrive0

2019-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset cad7abf8abe657b696b9c8deb4b727e0cefaf36d by Miss Islington (bot) 
in branch '3.8':
bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)
https://github.com/python/cpython/commit/cad7abf8abe657b696b9c8deb4b727e0cefaf36d


--
nosy: +miss-islington

___
Python tracker 

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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2019-09-04 Thread Justin ARthur

New submission from Justin ARthur :

Python 3 code with an identifier that has a non-spacing mark in it does not get 
tokenized by lib2to3 and will result in an exception thrown in the parsing 
process.

Parsing the attached file (badvar.py), results in `ParseError: bad token: 
type=58, value='̇', context=('', (1, 1))`

This happens because the Name pattern regular expression in lib2to3 is `r'\w+'` 
and the word character class doesn't contain non-spacing marks (and possible 
other [continuation characters allowed in Python 3 
identifiers](https://docs.python.org/3/reference/lexical_analysis.html#identifiers)).

(reported by energizer in the Python IRC channel)

--
components: 2to3 (2.x to 3.x conversion tool), Library (Lib)
files: badvar.py
messages: 351153
nosy: JustinTArthur
priority: normal
severity: normal
status: open
title: lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48592/badvar.py

___
Python tracker 

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



[issue38033] Use After Free: PyObject_Free

2019-09-04 Thread Chiaki Ishikawa


New submission from Chiaki Ishikawa :

Hi, 
I am new to Python bug tracker, so my setting of the fields may be inadequate. 
If so, apologies in advance.
I think Use After Free bug is a potential security issue and so wanted to 
report ASAP.

First my environment: I am using Debian GNU/Linux, and its kernel version is: 
uname -a output, 
SMP Debian 4.19.37-6 (2019-07-18) x86_64 GNU/Linux

Python version is:
# python3 --version
Python 3.7.4

mozilla thunderbird mail client testing framework uses
python as a test driver, and when I was checking the local build of thunderbird 
under a test suite invoked from |make mozmill| under valgrind (a memory usage 
checker), the first thing I noticed is the following message from valgrind.
PyObject_Free seems to access a memory location (4 octets) in an already freed 
block. This happened many times during the test.

I have not bothered to look into the source code of python, but a seasoned 
developer should be able to figure out where such reference is made.

>From valgrind log:

==30354== Invalid read of size 4
==30354==at 0x5A29FE: PyObject_Free (in /usr/bin/python3.7)
==30354==by 0x5B7337: ??? (in /usr/bin/python3.7)
==30354==by 0x5BBBFF: PyDict_SetItem (in /usr/bin/python3.7)
==30354==by 0x58DE19: PyType_Ready (in /usr/bin/python3.7)
==30354==by 0x6482A0: _Py_ReadyTypes (in /usr/bin/python3.7)
==30354==by 0x63551A: _Py_InitializeCore_impl (in /usr/bin/python3.7)
==30354==by 0x6357AA: _Py_InitializeCore (in /usr/bin/python3.7)
==30354==by 0x5E17EC: ??? (in /usr/bin/python3.7)
==30354==by 0x653D88: ??? (in /usr/bin/python3.7)
==30354==by 0x65424D: _Py_UnixMain (in /usr/bin/python3.7)
==30354==by 0x4ACB09A: (below main) (libc-start.c:308)
==30354==  Address 0x4c8b020 is 16 bytes after a block of size 576 free'd
==30354==at 0x4833FC0: free (vg_replace_malloc.c:538)
==30354==by 0x5B7337: ??? (in /usr/bin/python3.7)
==30354==by 0x5BBBFF: PyDict_SetItem (in /usr/bin/python3.7)
==30354==by 0x58DE19: PyType_Ready (in /usr/bin/python3.7)
==30354==by 0x6482A0: _Py_ReadyTypes (in /usr/bin/python3.7)
==30354==by 0x63551A: _Py_InitializeCore_impl (in /usr/bin/python3.7)
==30354==by 0x6357AA: _Py_InitializeCore (in /usr/bin/python3.7)
==30354==by 0x5E17EC: ??? (in /usr/bin/python3.7)
==30354==by 0x653D88: ??? (in /usr/bin/python3.7)
==30354==by 0x65424D: _Py_UnixMain (in /usr/bin/python3.7)
==30354==by 0x4ACB09A: (below main) (libc-start.c:308)
==30354==  Block was alloc'd at
==30354==at 0x4832E13: malloc (vg_replace_malloc.c:307)
==30354==by 0x5A4B16: PyObject_Malloc (in /usr/bin/python3.7)
==30354==by 0x5B72BD: ??? (in /usr/bin/python3.7)
==30354==by 0x5BBBFF: PyDict_SetItem (in /usr/bin/python3.7)
==30354==by 0x58DE19: PyType_Ready (in /usr/bin/python3.7)
==30354==by 0x6482A0: _Py_ReadyTypes (in /usr/bin/python3.7)
==30354==by 0x63551A: _Py_InitializeCore_impl (in /usr/bin/python3.7)
==30354==by 0x6357AA: _Py_InitializeCore (in /usr/bin/python3.7)
==30354==by 0x5E17EC: ??? (in /usr/bin/python3.7)
==30354==by 0x653D88: ??? (in /usr/bin/python3.7)
==30354==by 0x65424D: _Py_UnixMain (in /usr/bin/python3.7)
==30354==by 0x4ACB09A: (below main) (libc-start.c:308)
==30354==


TIA

--
components: Library (Lib)
messages: 351154
nosy: zephyrus00jp
priority: normal
severity: normal
status: open
title: Use After Free: PyObject_Free
type: security
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



[issue38033] Use After Free: PyObject_Free

2019-09-04 Thread Chiaki Ishikawa


Chiaki Ishikawa  added the comment:

Addtion:

PyObject_Realloc also has the issue of Use After Free: this may be more serious.


==31128== Invalid read of size 4
==31128==at 0x5A48CA: PyObject_Realloc (in /usr/bin/python3.7)
==31128==by 0x5DD8FB: _PyBytes_Resize (in /usr/bin/python3.7)
==31128==by 0x4F53BC: ??? (in /usr/bin/python3.7)
==31128==by 0x5D9A22: _PyMethodDef_RawFastCallKeywords (in 
/usr/bin/python3.7)
==31128==by 0x54C75F: ??? (in /usr/bin/python3.7)
==31128==by 0x5537DA: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54FA9B: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x54D0A1: _PyEval_EvalCodeWithName (in /usr/bin/python3.7)
==31128==by 0x5DA6E1: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54FA9B: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54F8FB: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x54D0A1: _PyEval_EvalCodeWithName (in /usr/bin/python3.7)
==31128==by 0x5DA6E1: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54F8FB: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54F8FB: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54C61F: ??? (in /usr/bin/python3.7)
==31128==by 0x5537DA: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54F8FB: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x54D0A1: _PyEval_EvalCodeWithName (in /usr/bin/python3.7)
==31128==by 0x54F3F2: PyEval_EvalCode (in /usr/bin/python3.7)
==31128==by 0x6313D1: ??? (in /usr/bin/python3.7)
==31128==by 0x631486: PyRun_FileExFlags (in /usr/bin/python3.7)
==31128==by 0x6320EE: PyRun_SimpleFileExFlags (in /usr/bin/python3.7)
==31128==by 0x653EED: ??? (in /usr/bin/python3.7)
==31128==by 0x65424D: _Py_UnixMain (in /usr/bin/python3.7)
==31128==by 0x4ACB09A: (below main) (libc-start.c:308)
==31128==  Address 0x5b21020 is 32,208 bytes inside a block of size 32,801 
free'd
==31128==at 0x4835259: realloc (vg_replace_malloc.c:834)
==31128==by 0x5A49AB: PyObject_Realloc (in /usr/bin/python3.7)
==31128==by 0x5DD8FB: _PyBytes_Resize (in /usr/bin/python3.7)
==31128==by 0x4F53BC: ??? (in /usr/bin/python3.7)
==31128==by 0x5D9A22: _PyMethodDef_RawFastCallKeywords (in 
/usr/bin/python3.7)
==31128==by 0x54C75F: ??? (in /usr/bin/python3.7)
==31128==by 0x5537DA: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54FA9B: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x54D0A1: _PyEval_EvalCodeWithName (in /usr/bin/python3.7)
==31128==by 0x5DA6E1: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54FA9B: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54F8FB: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x54D0A1: _PyEval_EvalCodeWithName (in /usr/bin/python3.7)
==31128==by 0x5DA6E1: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54F8FB: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54F8FB: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54C61F: ??? (in /usr/bin/python3.7)
==31128==by 0x5537DA: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x5DA3EB: _PyFunction_FastCallKeywords (in /usr/bin/python3.7)
==31128==by 0x54F8FB: _PyEval_EvalFrameDefault (in /usr/bin/python3.7)
==31128==by 0x54D0A1: _PyEval_EvalCodeWithName (in /usr/bin/python3.7)
==31128==by 0x54F3F2: PyEval_EvalCode (in /usr/bin/python3.7)
==31128==by 0x6313D1: ??? (in /usr/bin/python3.7)
==31128==by 0x631486: PyRun_FileExFlags (in /usr/bin/python3.7)
==31128==by 0x6320EE: PyRun_SimpleFileExFlags (in /usr/bin/python3.7)
==31128==by 0x653EED: ??? (in /usr/bin/python3.7)
==31128==by 0x65424D: _Py_UnixMain (in /usr/bin/python3.7)
==31128==by 0x4ACB09A: (below main) (libc-start.c:308)
==31128==  Block was alloc'd at
==31128==at 0x4832E13: malloc (vg_replace_malloc.c:307)
==31128==by 0x5DE3AA: PyBytes_FromStringAndSize (in /usr/bin/python3.7)
==31128==by 0x4F5375: ??? (in /usr/bin/python3.7)
==31128==by 0x5D9A22: _PyMethodDef_RawFastCallKeywords (in 
/usr/bin/pytho

[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15343
pull_request: https://github.com/python/cpython/pull/15685

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset 87bd2071c756188b6cd577889fb1682831142ceb by Miss Islington (bot) 
(Dong-hee Na) in branch 'master':
bpo-22347: Update mimetypes.guess_type to allow proper parsing of URLs 
(GH-15522)
https://github.com/python/cpython/commit/87bd2071c756188b6cd577889fb1682831142ceb


--
nosy: +miss-islington

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-09-04 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +15344
pull_request: https://github.com/python/cpython/pull/15686

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +15345
pull_request: https://github.com/python/cpython/pull/15687

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset 6d7a786d2e4b48a6b50614e042ace9ff996f0238 by Miss Islington (bot) 
in branch '3.8':
bpo-22347: Update mimetypes.guess_type to allow proper parsing of URLs 
(GH-15522)
https://github.com/python/cpython/commit/6d7a786d2e4b48a6b50614e042ace9ff996f0238


--

___
Python tracker 

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



[issue38031] FileIO.__init__ aborts when opener returns bad fd

2019-09-04 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +15346
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15688

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset 8873bff2871078e9f23e6c7d942d3a8edbd0921f by Miss Islington (bot) 
(Dong-hee Na) in branch '3.7':
[3.7] bpo-22347: Update mimetypes.guess_type to allow proper parsing of URLs 
(GH-15522) (GH-15687)
https://github.com/python/cpython/commit/8873bff2871078e9f23e6c7d942d3a8edbd0921f


--

___
Python tracker 

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



[issue38031] FileIO.__init__ aborts when opener returns bad fd

2019-09-04 Thread Zackery Spytz


Zackery Spytz  added the comment:

Thank you for the report.

--
components: +Interpreter Core
nosy: +ZackerySpytz
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-09-04 Thread Abhilash Raj


Abhilash Raj  added the comment:


New changeset 6ad0a2c45f78020f7994e47620c1cf7b225f8197 by Abhilash Raj in 
branch '3.8':
[3.8] bpo-37764: Fix infinite loop when parsing unstructured email headers. 
(GH-15239) (GH-15686)
https://github.com/python/cpython/commit/6ad0a2c45f78020f7994e47620c1cf7b225f8197


--

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-09-04 Thread Abhilash Raj


Change by Abhilash Raj :


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



[issue38034] Typo on logging.handlers.QueueListener documentation

2019-09-04 Thread wuck


New submission from wuck :

There appears to be a typo on the documentation page for 
logging.handlers.QueueListener at 
https://docs.python.org/3/library/logging.handlers.html#logging.handlers.QueueListener

The line "Changed in version 3.5: The respect_handler_levels argument was 
added." should instead refer to "Changed in version 3.5: The 
respect_handler_level argument was added.", removing the 's' at the end of 
respect_handler_level.

--
assignee: docs@python
components: Documentation
messages: 351161
nosy: docs@python, wuck
priority: normal
severity: normal
status: open
title: Typo on logging.handlers.QueueListener documentation
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner(my mentor) @maxking
Now this issue is solved.
I'd like to close this issue. Is it okay?

--
nosy: +maxking, vstinner

___
Python tracker 

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



[issue38033] Use After Free: PyObject_Free

2019-09-04 Thread Chiaki Ishikawa


Chiaki Ishikawa  added the comment:

PyMem_Free and PyMem_Realloc also suffer from similar "Use After Free" issue.

The standard version of Python3.7 interpreter does not seem to have debug 
symbol and so I installed a debug version of it. Now it seems to have a shadow 
symbol of inlined function so that we can now learn the line numbers of 
functions where the problem occurs in more detail. I am attaching the  valgrind 
log excerpts for PyObj_Free, PyObj_Realloc, PyMem_Free, PyMem_Realloc, etc.

Sorry for piecemeal reporting. The earlier messages swamp the log very 
verbosely and so I had to disable the reporting one by one.

PS: There seem to be cases where the result of reading uninitialized value is 
used for conditional testing, too.

--
Added file: https://bugs.python.org/file48593/PyMem_Free.txt

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread Abhilash Raj


Abhilash Raj  added the comment:

I think so, yes.

Also, while you are at it, can you also close bpo-35939 with a comment that 
points to this issue and the right PR for the fix?

--

___
Python tracker 

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



[issue38033] Use After Free: PyObject_Free

2019-09-04 Thread Chiaki Ishikawa


Chiaki Ishikawa  added the comment:

I found that the inlined functions are used by other functions and resulted in 
similar issues. Once obmalloc.c is fixed, I think such problems are 
automatically fixed.

--

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-09-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 2cd902585815582eb059e3b40e014ebe4e7fdee7 by Terry Jan Reedy 
(GeeTransit) in branch 'master':
bpo-37902: IDLE: Add scrolling for IDLE browsers. (#15368)
https://github.com/python/cpython/commit/2cd902585815582eb059e3b40e014ebe4e7fdee7


--

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread Dong-hee Na


Dong-hee Na  added the comment:

Great! I will close bpo-35939 also.

--

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15347
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/15689

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15348
pull_request: https://github.com/python/cpython/pull/15690

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread Dong-hee Na


Change by Dong-hee Na :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-09-04 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue35939] Remove urllib.parse._splittype from mimetypes.guess_type

2019-09-04 Thread Dong-hee Na


Dong-hee Na  added the comment:

This issue is fixed by
https://github.com/python/cpython/pull/15522

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.9

___
Python tracker 

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



[issue38033] Use After Free: PyObject_Free (valgrind)

2019-09-04 Thread Tim Peters


Tim Peters  added the comment:

You're probably chasing ghosts ;-)  Please read about what needs to be done to 
use valgrind successfully with Python:

https://github.com/python/cpython/blob/master/Misc/README.valgrind

--
nosy: +tim.peters
title: Use After Free: PyObject_Free -> Use After Free: PyObject_Free (valgrind)

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset 9c2654d1aa85968fede1b888fba86aebc06c5be6 by Miss Islington (bot) 
in branch '3.8':
bpo-37902: IDLE: Add scrolling for IDLE browsers. (GH-15368)
https://github.com/python/cpython/commit/9c2654d1aa85968fede1b888fba86aebc06c5be6


--
nosy: +miss-islington

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset 16af39aa84cc3553c51d57461964ab4e28029184 by Miss Islington (bot) 
in branch '3.7':
bpo-37902: IDLE: Add scrolling for IDLE browsers. (GH-15368)
https://github.com/python/cpython/commit/16af39aa84cc3553c51d57461964ab4e28029184


--

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-09-04 Thread Abhilash Raj


Change by Abhilash Raj :


--
resolution:  -> fixed

___
Python tracker 

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



[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 8f9cc8771ffb8d0e21be287eaed42ae06087acca by Inada Naoki in branch 
'master':
bpo-38026: fix inspect.getattr_static (GH-15676)
https://github.com/python/cpython/commit/8f9cc8771ffb8d0e21be287eaed42ae06087acca


--

___
Python tracker 

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



[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15349
pull_request: https://github.com/python/cpython/pull/15692

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-09-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thanks for the patch.  More IDLE patches would be welcome should you want to 
attack something else.

Possible browser scrolling refinements:

1. Scroll by an integral number of labels.  This is easy with text.  For our 
synthesized tree, we would have to calculate the # of canvas pixels to scroll.  
However, if we switch to ttk.Treeview (#31552), it, like Text has a height in 
lines.  So its yview method might scroll in line units, like text.

2. Only bind wheel event(s) used on system?  Should test on 3 systems. Do all 
*nix other than  tk for macOS use X-window buttons?  Not a big deal.

3. Use bindtags to bind wheel events just once. Then unbind when shutdown?  
(Check if unbind elsewhere.)

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



[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset bdcbb83c6640c2b30d0e1a2a497e9ba34cc53b26 by Miss Islington (bot) 
in branch '3.8':
bpo-38026: fix inspect.getattr_static (GH-15676)
https://github.com/python/cpython/commit/bdcbb83c6640c2b30d0e1a2a497e9ba34cc53b26


--
nosy: +miss-islington

___
Python tracker 

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



[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread Inada Naoki


Change by Inada Naoki :


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



[issue38035] shared_semaphores cannot be shared across unrelated processes

2019-09-04 Thread Vinay Sharma


New submission from Vinay Sharma :

Currently, shared semaphores can only be created, and existing semaphores can't 
be opened. Shared semaphores are opened using the following command.
```
sem_open(name, O_CREAT | O_EXCL, 0600, val)
```
This will raise error if a semaphore which already exists.
This behaviour works well when the file descriptors of these semaphores can be 
shared with children processes.

But, it doesn't work when an unrelated process which needs access to shared 
semaphore tries to open it.

--
components: Library (Lib)
messages: 351176
nosy: vinay0410
priority: normal
severity: normal
status: open
title: shared_semaphores cannot be shared across unrelated processes
versions: Python 3.9

___
Python tracker 

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



[issue38035] shared_semaphores cannot be shared across unrelated processes

2019-09-04 Thread Vinay Sharma


Change by Vinay Sharma :


--
type:  -> enhancement

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-09-04 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

Should we get a CVE for this because this is a security issue?

--

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-04 Thread Tal Einat


Tal Einat  added the comment:

> Would it be possible to tell pickle to serialize .isocalendar() as a tuple, 
> and deserialize it from a tuple to a structseq?

The former is possible but that latter is not: If the object is pickled as a 
tuple, it will always be unpickled as a simple tuple. To customize unpickling, 
the serialized data must include the name of the class to use, and that class 
will never exist in earlier Python versions. I don't think there's a way around 
this.

However, I find Raymond's note very convincing, in that we should likely not 
let the unpickling issue get in the way of this improvement:

> FWIW, most things in Python that return a structseq previously returned a 
> tuple (for example, time.localtime() and sys.version_info).
>
> This is not an unprecedented upgrade to improve the repr and provide access 
> by field name in addition to positional access.

--

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-09-04 Thread Niels Albers


Niels Albers  added the comment:

Thanks Srinivas for the suggestion. IMO exception chaining has more utility 
than only dealing with new exceptions that are caused by exception handling. 
It's all about preserving exception context. As both a writer of libraries and 
a user of such, I do like to have a full context chain when I have to handle an 
exception (or more importantly as a devops engineeer: log it)

Is this edit acceptable?

"If you need to track exception context, you can use exception chaining. You 
can chain exceptions by using the ``from`` clause. Just raise a new exception 
class or instance from an existing exception. The existing exception will be 
set as 
the cause for the new exception."

--

___
Python tracker 

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



[issue18049] Re-enable threading test on macOS

2019-09-04 Thread Kyle Stanley


Kyle Stanley  added the comment:

Ronald, is it feasible that the changes made in 
https://github.com/python/cpython/pull/14748/files to THREAD_STACK_SIZE in 
Python/thread_pthread.h could be causing intermittent failures for the Azure 
macOS PR tests?

In a recent PR (https://github.com/python/cpython/pull/15651), 
test_pending_calls_race (test.test_concurrent_futures.ThreadPoolWaitTests) 
seemed to be timing out. See the build log for more details:  
https://dev.azure.com/Python/cpython/_build/results?buildId=49786&view=logs&j=18d1a34d-6940-5fc1-f55b-405e2fba32b1.

It doesn't appear to be causing consistent failures for Azure, but the latest 
commit to PR-15651 was only involving a formatting change to the news entry, so 
it should not have had any influence on the test that timed out. Prior to that 
commit, there were no CI failures.

--
nosy: +aeros167

___
Python tracker 

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



[issue37934] Docs: Clarify NotImplemented use cases

2019-09-04 Thread Kyle Stanley


Kyle Stanley  added the comment:

> As you say, we currently have only one usage of NotImplemented outside its 
> intended purpose. Maybe we should wait to see whether it becomes at least a 
> little bit more popular, before thinking about blessing it.

> I know at least 3 in CPython, so it's not so rare to use NotImplemented for 
> something else than binary operators


I'm thinking that it might be worthwhile to start a discussion about this on 
python-dev, to see what the others think about how the NotImplemented docs 
should be defined, and whether or not it should be used outside of binary 
operators.

Based on the feedback from Raymond and Vedran, I'm in agreement that it might 
not be the best idea in the long term to keep adding additional use cases to 
the documentation. But, it really doesn't make much sense to me that the 
constant is entirely defined around a single use case in the doc while we're 
using it for other purposes throughout CPython.

--

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +15350
pull_request: https://github.com/python/cpython/pull/15693

___
Python tracker 

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