Bug 1697574

Summary: python-prompt_toolkit throws DeprecationWarning
Product: [Fedora] Fedora Reporter: Carmen Bianca Bakker <carmen>
Component: python-prompt_toolkitAssignee: Carl George <carl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: carl, me
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-prompt_toolkit-1.0.16-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-25 01:33:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Carmen Bianca Bakker 2019-04-08 17:37:23 UTC
Description of problem: I am packaging xonsh 0.8.12 for Fedora 29. When I launch xonsh, I get the following output:

$ /bin/xonsh
/usr/lib/python3.7/site-packages/prompt_toolkit/styles/from_dict.py:9: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping
carmen@carmen-thinkpad ~/Projektoj/xonsh.bak f30 $


Version-Release number of selected component (if applicable): 1.0.15-1


How reproducible:


Steps to Reproduce:
1. Launch
2. Run the following commands:
>>> import warnings
>>> warnings.filterwarnings('always', category=DeprecationWarning)
>>> import prompt_toolkit.styles.from_dict



Actual results:

You get the following deprecation warning:

/usr/lib/python3.7/site-packages/prompt_toolkit/styles/from_dict.py:9: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping


Expected results:

You get no deprecation warning.


Additional info:

Comment 1 Carmen Bianca Bakker 2019-04-08 17:58:08 UTC
Submitted a fix at https://src.fedoraproject.org/rpms/python-prompt_toolkit/pull-request/2

Comment 2 Carl George 2019-04-08 18:47:18 UTC
I can reproduce the error.  Good news is in F30 we've switched to prompt_toolkit 2, which as best I can tell no longer imports collections.Mapping anywhere.  Have you reported this upstream?  They have a 1.0 branch, which would be the ideal way to fix this.  If upstream ignores or refuses then your pull request to add a patch looks fine, but we need to try upstream first.

Comment 3 Carmen Bianca Bakker 2019-04-08 19:02:07 UTC
The upstream 1.0 branch hasn't been maintained/updated as far as I can see.  I'll report the bug upstream and send a link to bz, but I doubt there'll be a release.

Comment 5 Carl George 2019-04-08 20:00:52 UTC
Thanks for reporting the issue upstream.  Per the guidelines we should at least try.

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_all_patches_should_have_an_upstream_bug_link_or_comment

I imagine for such a trivial fix upstream will fix it in the 1.0 branch and maybe even tag a 1.0.16 for us.  If we haven't heard back by next week I'll go ahead and merge your pull request.

Comment 6 Carmen Bianca Bakker 2019-04-08 20:17:34 UTC
Understandable. Thank you for letting me know.

Comment 7 Carl George 2019-04-14 14:05:49 UTC
I see upstream has added the fix to the 1.0 branch and tagged 1.0.16.  Would you like to change your pull request to update to that version instead of adding a patch?  If not I can just close it and take care of the update myself.

Comment 8 Carmen Bianca Bakker 2019-04-14 14:13:48 UTC
If you have time to do that, that's good. Otherwise it'll take me a few days to find time to verify 1.0.16 and alter the PR.

Comment 9 Fedora Update System 2019-04-14 15:57:19 UTC
python-prompt_toolkit-1.0.16-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-ab10789cd2

Comment 10 Fedora Update System 2019-04-15 20:43:39 UTC
python-prompt_toolkit-1.0.16-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-ab10789cd2

Comment 11 Fedora Update System 2019-04-25 01:33:29 UTC
python-prompt_toolkit-1.0.16-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.