Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1242599

Summary: Regression in bs4 4.4.0 when manipulating html document
Product: [Fedora] Fedora Reporter: Michal Hlavinka <mhlavink>
Component: python-beautifulsoup4Assignee: Terje Røsten <terjeros>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: hhorak, rbean, terjeros
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-04 19:12:13 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:
Attachments:
Description Flags
reproducer.py none

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.