[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread miss-islington


miss-islington  added the comment:


New changeset bf55a799e0c19285b094d71f794c301c1afaa28d by Miss Islington (bot) 
in branch '3.10':
bpo-44451: Reset DeprecationWarning filters in 
test_importlib.test_entry_points_by_index (GH-26784)
https://github.com/python/cpython/commit/bf55a799e0c19285b094d71f794c301c1afaa28d


--

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Big thanks Miro for the detailed work on this matter.

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +25374
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26790

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Jason R. Coombs

Jason R. Coombs  added the comment:


New changeset df1502e47fc1e0cf1e7d460ae04530c3e2e4a7c6 by Miro Hrončok in 
branch 'main':
bpo-44451: Reset DeprecationWarning filters in 
test_importlib.test_entry_points_by_index (GH-26784)
https://github.com/python/cpython/commit/df1502e47fc1e0cf1e7d460ae04530c3e2e4a7c6


--

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

Miro Hrončok  added the comment:

Submitted to both.

https://github.com/python/cpython/pull/26784
https://github.com/python/importlib_metadata/pull/325

--
components: +Tests -Library (Lib)

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

Other tests reset the filters? Good observation. I’d missed that detail. If 
it’s easier to submit a PR to importlib_metadata, feel free to do that as I’ll 
want the change in both places.

--
components: +Library (Lib) -Tests
stage: patch review -> 

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

Change by Miro Hrončok :


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

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

Change by Miro Hrončok :


--
components: +Tests -Library (Lib)

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

Miro Hrončok  added the comment:

Adding the reset to the context manager:

with warnings.catch_warnings(record=True) as caught:
warnings.resetwarnings()
eps[0]

Or even better explicitly:

with warnings.catch_warnings(record=True) as caught:
warnings.filterwarnings("default", category=DeprecationWarning)
eps[0]

Makes it pass and makes the tests framework happy. I still don't understand why 
it is filtered, but other tests in the file (e.g. 
test_entry_points_dict_construction) already o this, so I will submit a pull 
request.

--

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

Miro Hrončok  added the comment:

I've added warnings.resetwarnings() to the test. it makes it pass.

It says:


Warning -- warnings.filters was modified by test_importlib
  Before: (140568295281984, [('default', None, , 
'__main__', 0), ('ignore', None, , None, 0), 
('ignore', None, , None, 0), ('ignore', 
None, , None, 0), ('ignore', None, , None, 0)], [('default', None, , 
'__main__', 0), ('ignore', None, , None, 0), 
('ignore', None, , None, 0), ('ignore', 
None, , None, 0), ('ignore', None, , None, 0)])
  After:  (140568295281984, [('default', None, , 
'__main__', 0), ('ignore', None, , None, 0), 
('ignore', None, , None, 0), ('ignore', 
None, , None, 0), ('ignore', None, , None, 0)], []) 
test_importlib failed (env changed)

--

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

Miro Hrončok  added the comment:

I get the DeprecationWarning the tests assumes when not running via the test:

$ cat distinfo_pkg-1.0.0.dist-info/entry_points.txt 
[entries]
main = mod:main
ns:sub = mod:main

$ ./python
Python 3.11.0a0 (heads/main:0982ded179, Jun 18 2021, 14:14:16) [GCC 10.3.1 
20210422 (Red Hat 10.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> sys.path.insert(0, os.path.abspath('.'))
>>> from importlib.metadata import distribution
>>> distribution('distinfo-pkg')

>>> eps = distribution('distinfo-pkg').entry_points
>>> eps[0]
:1: DeprecationWarning: Accessing entry points by index is deprecated. 
Cast to tuple if needed.
EntryPoint(name='main', value='mod:main', group='entries')


Not sure why I don't get it in the test yet.

--

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

Miro Hrončok  added the comment:

Also reproducible without --enable-shared.

[cpython (main)]$ ./configure && make
[cpython (main)]$ ./python --version
Python 3.11.0a0

[cpython (main)]$ ./python -m test test_importlib
0:00:00 load avg: 5.40 Run tests sequentially
0:00:00 load avg: 5.40 [1/1] test_importlib
test test_importlib failed -- Traceback (most recent call last):
  File 
"/home/churchyard/Dokumenty/RedHat/cpython/Lib/test/test_importlib/test_metadata_api.py",
 line 145, in test_entry_points_by_index
expected = next(iter(caught))
StopIteration

test_importlib failed

== Tests result: FAILURE ==

1 test failed:
test_importlib

Total duration: 3.5 sec
Tests result: FAILURE

--

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to have been reported also at 
https://bugs.python.org/issue44246#msg395202

--
nosy: +xtreak

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

Miro Hrončok  added the comment:

Also reproduced on the main branch.

--
versions: +Python 3.11

___
Python tracker 

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



[issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34

2021-06-18 Thread Miro Hrončok

New submission from Miro Hrončok :

Hello.

When we attempted to upgrade to Python 3.10.0b3 on Fedora 33 and 34, we see the 
following test failure:



==
ERROR: test_entry_points_by_index 
(test.test_importlib.test_metadata_api.APITests)
Prior versions of Distribution.entry_points would return a
--
Traceback (most recent call last):
  File 
"/builddir/build/BUILD/Python-3.10.0b3/Lib/test/test_importlib/test_metadata_api.py",
 line 145, in test_entry_points_by_index
expected = next(iter(caught))
StopIteration
--
Ran 1402 tests in 2.125s
FAILED (errors=1, skipped=18, expected failures=1)


I've reproduced it without any Fedora's patches:

$ cd cpython
$ git switch -d v3.10.0b3  # or the tip of 3.10 today, 77eaf14d27

$ ./configure --enable-shared && make

$ LD_LIBRARY_PATH=. ./python -m test test_importlib
0:00:00 load avg: 13.59 Run tests sequentially
0:00:00 load avg: 13.59 [1/1] test_importlib
test test_importlib failed -- Traceback (most recent call last):
  File 
"/home/churchyard/Dokumenty/RedHat/cpython/Lib/test/test_importlib/test_metadata_api.py",
 line 145, in test_entry_points_by_index
expected = next(iter(caught))
StopIteration

test_importlib failed

== Tests result: FAILURE ==

1 test failed:
test_importlib

Total duration: 11.0 sec
Tests result: FAILURE

--
components: Library (Lib)
messages: 396051
nosy: hroncok, jaraco
priority: normal
severity: normal
status: open
title: test_entry_points_by_index 
(test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34
type: behavior
versions: Python 3.10

___
Python tracker 

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