Bug 1242599 - Regression in bs4 4.4.0 when manipulating html document
Summary: Regression in bs4 4.4.0 when manipulating html document
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-beautifulsoup4
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Terje Røsten
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-13 17:05 UTC by Michal Hlavinka
Modified: 2015-10-13 06:51 UTC (History)
3 users (show)

Fixed In Version: python-beautifulsoup4-4.4.1-1.fc23 python-beautifulsoup4-4.4.1-1.fc22 python-beautifulsoup4-4.4.1-1.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-04 19:12:13 UTC


Attachments (Terms of Use)
reproducer.py (3.10 KB, text/plain)
2015-07-13 17:05 UTC, Michal Hlavinka
no flags Details

Description Michal Hlavinka 2015-07-13 17:05:15 UTC
Created attachment 1051473 [details]
reproducer.py

Description of problem:
bs4 4.4.0 update breaks our script that works with previous version 4.3.2-3

Version-Release number of selected component (if applicable):
python3-beautifulsoup4-4.4.0-1.fc22.noarch

How reproducible:
always

Steps to Reproduce:
1. ./reproducer.py
2.
3.

Actual results:

dst= <class 'bs4.element.Tag'> 
 src1= <class 'bs4.element.Tag'>
dst= <class 'bs4.element.Tag'> 
 src2= <class 'bs4.element.Tag'>
dst= <class 'bs4.element.Tag'> 
 src3= <class 'NoneType'>
Traceback (most recent call last):
  File "./reproducer.py", line 84, in <module>
    update_html_template(html, 3) # regression
  File "./reproducer.py", line 75, in update_html_template
    dst.insert(0, src3)
  File "/usr/lib/python3.4/site-packages/bs4/element.py", line 317, in insert
    new_child.parent = self
AttributeError: 'NoneType' object has no attribute 'parent'

src3 find call fails which causes this backtrace

Expected results:
dst= <class 'bs4.element.Tag'> 
 src1= <class 'bs4.element.Tag'>
dst= <class 'bs4.element.Tag'> 
 src2= <class 'bs4.element.Tag'>
dst= <class 'bs4.element.Tag'> 
 src3= <class 'bs4.element.Tag'>
DONE
<class 'bs4.BeautifulSoup'>

Additional info:

Comment 1 Jozef Mlich 2015-07-15 08:23:02 UTC
Reported also to upstream bug tracker https://bugs.launchpad.net/beautifulsoup/+bug/1474732

Comment 2 Terje Røsten 2015-07-15 09:00:11 UTC
Thanks for report!

Comment 3 Fedora Update System 2015-10-03 14:41:40 UTC
python-beautifulsoup4-4.4.1-1.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-0aacd6a0a8

Comment 4 Fedora Update System 2015-10-03 14:41:51 UTC
python-beautifulsoup4-4.4.1-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-b5bc948c58

Comment 5 Fedora Update System 2015-10-04 01:35:15 UTC
python-beautifulsoup4-4.4.1-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update python-beautifulsoup4'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-0f9c92ca7f

Comment 6 Fedora Update System 2015-10-04 01:51:01 UTC
python-beautifulsoup4-4.4.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update python-beautifulsoup4'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-b5bc948c58

Comment 7 Fedora Update System 2015-10-04 02:20:32 UTC
python-beautifulsoup4-4.4.1-1.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update python-beautifulsoup4'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-0aacd6a0a8

Comment 8 Fedora Update System 2015-10-04 19:12:09 UTC
python-beautifulsoup4-4.4.1-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2015-10-07 06:20:13 UTC
python-beautifulsoup4-4.4.1-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2015-10-13 06:51:31 UTC
python-beautifulsoup4-4.4.1-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.