starting phase `set-SOURCE-DATE-EPOCH' phase `set-SOURCE-DATE-EPOCH' succeeded after 0.0 seconds starting phase `set-paths' environment variable `PATH' set to `/gnu/store/44s0j9is012nbww47d00pkxlznc92g9q-python-wrapper-3.8.2/bin:/gnu/store/gww59gv5qxbfijg3vk5y182im7923s06-tar-1.32/bin:/gnu/store/2ayciqwxddkzq183dac82ijljc14j4zj-gzip-1.10/bin:/gnu/store/n1jk0w2wa4vpwmixaqn2y3la1l2sizzi-bzip2-1.0.8/bin:/gnu/store/7p36raqgk6vn47bflxc9bsclqiib3phi-xz-5.2.4/bin:/gnu/store/lpkf3ydcdvxn8gcrzaq9cp3ri05h8qhs-file-5.38/bin:/gnu/store/6gqaw09zqw8w0vcax6simlq71bq7l5r0-diffutils-3.7/bin:/gnu/store/qw20chpgkgbcqmzhs60c8hjl1hmblyc8-patch-2.7.6/bin:/gnu/store/b5y5scfmh2d8kxcpl9p84294z2198cgf-findutils-4.7.0/bin:/gnu/store/9iwlsj7d6ffqhshy8qshf7p4fqwfwrvn-gawk-5.0.1/bin:/gnu/store/q1nfjb24vqjs1cgi8mlnskw34h16y09r-sed-4.8/bin:/gnu/store/4qr6mcvsxyzknxa7x1wny8x30f5i0r3n-grep-3.4/bin:/gnu/store/2v61vg0bizgrhybkqbrki2k7kr094waz-coreutils-8.32/bin:/gnu/store/b7jbh7kzzig0bxfswdj8nfj9bkljyyya-make-4.3/bin:/gnu/store/v1g7f3p4f0851mywrla8qmr9hb8jgfjr-bash-minimal-5.0.16/bin:/gnu/store/dyqxnydqk1810afjfbqzfvh0n83xyl62-ld-wrapper-0/bin:/gnu/store/50lyzn9bz6x4da66648kry29wn8afird-binutils-2.34/bin:/gnu/store/afpgzln8860m6yfhxy6i8n9rywbp85cy-gcc-7.5.0/bin:/gnu/store/z4li262il798hbl0l1h1k3a5g7r6bffa-glibc-2.31/bin:/gnu/store/z4li262il798hbl0l1h1k3a5g7r6bffa-glibc-2.31/sbin:/gnu/store/jkngay2hcmxzi5y35hajq6ak6flh2108-python-3.8.2/bin' environment variable `PYTHONPATH' set to `/gnu/store/5bppz01s1lh9pp63hmw4f588fpysiy8f-python-soupsieve-2.2.1/lib/python3.8/site-packages:/gnu/store/jkngay2hcmxzi5y35hajq6ak6flh2108-python-3.8.2/lib/python3.8/site-packages' environment variable `BASH_LOADABLES_PATH' unset environment variable `C_INCLUDE_PATH' set to `/gnu/store/n1jk0w2wa4vpwmixaqn2y3la1l2sizzi-bzip2-1.0.8/include:/gnu/store/7p36raqgk6vn47bflxc9bsclqiib3phi-xz-5.2.4/include:/gnu/store/lpkf3ydcdvxn8gcrzaq9cp3ri05h8qhs-file-5.38/include:/gnu/store/9iwlsj7d6ffqhshy8qshf7p4fqwfwrvn-gawk-5.0.1/include:/gnu/store/b7jbh7kzzig0bxfswdj8nfj9bkljyyya-make-4.3/include:/gnu/store/50lyzn9bz6x4da66648kry29wn8afird-binutils-2.34/include:/gnu/store/afpgzln8860m6yfhxy6i8n9rywbp85cy-gcc-7.5.0/include:/gnu/store/z4li262il798hbl0l1h1k3a5g7r6bffa-glibc-2.31/include:/gnu/store/jkngay2hcmxzi5y35hajq6ak6flh2108-python-3.8.2/include:/gnu/store/hk7l42fwxmnrnlhyiixvaqf1i1crcckp-linux-libre-headers-5.4.20/include' environment variable `CPLUS_INCLUDE_PATH' set to `/gnu/store/n1jk0w2wa4vpwmixaqn2y3la1l2sizzi-bzip2-1.0.8/include:/gnu/store/7p36raqgk6vn47bflxc9bsclqiib3phi-xz-5.2.4/include:/gnu/store/lpkf3ydcdvxn8gcrzaq9cp3ri05h8qhs-file-5.38/include:/gnu/store/9iwlsj7d6ffqhshy8qshf7p4fqwfwrvn-gawk-5.0.1/include:/gnu/store/b7jbh7kzzig0bxfswdj8nfj9bkljyyya-make-4.3/include:/gnu/store/50lyzn9bz6x4da66648kry29wn8afird-binutils-2.34/include:/gnu/store/afpgzln8860m6yfhxy6i8n9rywbp85cy-gcc-7.5.0/include/c++:/gnu/store/afpgzln8860m6yfhxy6i8n9rywbp85cy-gcc-7.5.0/include:/gnu/store/z4li262il798hbl0l1h1k3a5g7r6bffa-glibc-2.31/include:/gnu/store/jkngay2hcmxzi5y35hajq6ak6flh2108-python-3.8.2/include:/gnu/store/hk7l42fwxmnrnlhyiixvaqf1i1crcckp-linux-libre-headers-5.4.20/include' environment variable `LIBRARY_PATH' set to `/gnu/store/5bppz01s1lh9pp63hmw4f588fpysiy8f-python-soupsieve-2.2.1/lib:/gnu/store/n1jk0w2wa4vpwmixaqn2y3la1l2sizzi-bzip2-1.0.8/lib:/gnu/store/7p36raqgk6vn47bflxc9bsclqiib3phi-xz-5.2.4/lib:/gnu/store/lpkf3ydcdvxn8gcrzaq9cp3ri05h8qhs-file-5.38/lib:/gnu/store/9iwlsj7d6ffqhshy8qshf7p4fqwfwrvn-gawk-5.0.1/lib:/gnu/store/50lyzn9bz6x4da66648kry29wn8afird-binutils-2.34/lib:/gnu/store/z4li262il798hbl0l1h1k3a5g7r6bffa-glibc-2.31/lib:/gnu/store/rzk3v28mhi4m7sh0qippp9a5rzy03rkg-glibc-2.31-static/lib:/gnu/store/x6i3vfg4gaqd42cqb6mzk52v4lds1467-glibc-utf8-locales-2.31/lib:/gnu/store/jkngay2hcmxzi5y35hajq6ak6flh2108-python-3.8.2/lib' environment variable `GUIX_LOCPATH' set to `/gnu/store/x6i3vfg4gaqd42cqb6mzk52v4lds1467-glibc-utf8-locales-2.31/lib/locale' phase `set-paths' succeeded after 0.0 seconds starting phase `install-locale' using 'en_US.utf8' locale for category "LC_ALL" phase `install-locale' succeeded after 0.0 seconds starting phase `unpack' beautifulsoup4-4.9.3/ beautifulsoup4-4.9.3/COPYING.txt beautifulsoup4-4.9.3/LICENSE beautifulsoup4-4.9.3/MANIFEST.in beautifulsoup4-4.9.3/NEWS.txt beautifulsoup4-4.9.3/PKG-INFO beautifulsoup4-4.9.3/README.md beautifulsoup4-4.9.3/TODO.txt beautifulsoup4-4.9.3/beautifulsoup4.egg-info/ beautifulsoup4-4.9.3/beautifulsoup4.egg-info/PKG-INFO beautifulsoup4-4.9.3/beautifulsoup4.egg-info/SOURCES.txt beautifulsoup4-4.9.3/beautifulsoup4.egg-info/dependency_links.txt beautifulsoup4-4.9.3/beautifulsoup4.egg-info/requires.txt beautifulsoup4-4.9.3/beautifulsoup4.egg-info/top_level.txt beautifulsoup4-4.9.3/bs4/ beautifulsoup4-4.9.3/bs4/__init__.py beautifulsoup4-4.9.3/bs4/builder/ beautifulsoup4-4.9.3/bs4/builder/__init__.py beautifulsoup4-4.9.3/bs4/builder/_html5lib.py beautifulsoup4-4.9.3/bs4/builder/_htmlparser.py beautifulsoup4-4.9.3/bs4/builder/_lxml.py beautifulsoup4-4.9.3/bs4/dammit.py beautifulsoup4-4.9.3/bs4/diagnose.py beautifulsoup4-4.9.3/bs4/element.py beautifulsoup4-4.9.3/bs4/formatter.py beautifulsoup4-4.9.3/bs4/testing.py beautifulsoup4-4.9.3/bs4/tests/ beautifulsoup4-4.9.3/bs4/tests/__init__.py beautifulsoup4-4.9.3/bs4/tests/test_builder_registry.py beautifulsoup4-4.9.3/bs4/tests/test_docs.py beautifulsoup4-4.9.3/bs4/tests/test_html5lib.py beautifulsoup4-4.9.3/bs4/tests/test_htmlparser.py beautifulsoup4-4.9.3/bs4/tests/test_lxml.py beautifulsoup4-4.9.3/bs4/tests/test_soup.py beautifulsoup4-4.9.3/bs4/tests/test_tree.py beautifulsoup4-4.9.3/convert-py3k beautifulsoup4-4.9.3/doc/ beautifulsoup4-4.9.3/doc/Makefile beautifulsoup4-4.9.3/doc/source/ beautifulsoup4-4.9.3/doc/source/6.1.jpg beautifulsoup4-4.9.3/doc/source/check_doc.py beautifulsoup4-4.9.3/doc/source/conf.py beautifulsoup4-4.9.3/doc/source/index.rst beautifulsoup4-4.9.3/doc.ptbr/ beautifulsoup4-4.9.3/doc.ptbr/Makefile beautifulsoup4-4.9.3/doc.ptbr/source/ beautifulsoup4-4.9.3/doc.ptbr/source/6.1.jpg beautifulsoup4-4.9.3/doc.ptbr/source/conf.py beautifulsoup4-4.9.3/doc.ptbr/source/index.rst beautifulsoup4-4.9.3/doc.ru/ beautifulsoup4-4.9.3/doc.ru/Makefile beautifulsoup4-4.9.3/doc.ru/source/ beautifulsoup4-4.9.3/doc.ru/source/6.1.jpg beautifulsoup4-4.9.3/doc.ru/source/bs4ru.rst beautifulsoup4-4.9.3/doc.ru/source/conf.py beautifulsoup4-4.9.3/doc.ru/source/index.rst beautifulsoup4-4.9.3/doc.zh/ beautifulsoup4-4.9.3/doc.zh/Makefile beautifulsoup4-4.9.3/doc.zh/source/ beautifulsoup4-4.9.3/doc.zh/source/6.1.jpg beautifulsoup4-4.9.3/doc.zh/source/conf.py beautifulsoup4-4.9.3/doc.zh/source/index.rst beautifulsoup4-4.9.3/scripts/ beautifulsoup4-4.9.3/scripts/demonstrate_parser_differences.py beautifulsoup4-4.9.3/scripts/demonstration_markup.txt beautifulsoup4-4.9.3/setup.cfg beautifulsoup4-4.9.3/setup.py beautifulsoup4-4.9.3/test-all-versions phase `unpack' succeeded after 0.1 seconds starting phase `ensure-no-mtimes-pre-1980' phase `ensure-no-mtimes-pre-1980' succeeded after 0.0 seconds starting phase `enable-bytecode-determinism' phase `enable-bytecode-determinism' succeeded after 0.0 seconds starting phase `patch-usr-bin-file' phase `patch-usr-bin-file' succeeded after 0.0 seconds starting phase `patch-source-shebangs' patch-shebang: ./convert-py3k: changing `/bin/sh' to `/gnu/store/v1g7f3p4f0851mywrla8qmr9hb8jgfjr-bash-minimal-5.0.16/bin/sh' phase `patch-source-shebangs' succeeded after 0.0 seconds starting phase `patch-generated-file-shebangs' phase `patch-generated-file-shebangs' succeeded after 0.0 seconds starting phase `build' running "python setup.py" with command "build" and parameters () running build running build_py creating build creating build/lib creating build/lib/bs4 copying bs4/testing.py -> build/lib/bs4 copying bs4/dammit.py -> build/lib/bs4 copying bs4/element.py -> build/lib/bs4 copying bs4/__init__.py -> build/lib/bs4 copying bs4/formatter.py -> build/lib/bs4 copying bs4/diagnose.py -> build/lib/bs4 creating build/lib/bs4/tests copying bs4/tests/test_builder_registry.py -> build/lib/bs4/tests copying bs4/tests/test_html5lib.py -> build/lib/bs4/tests copying bs4/tests/test_lxml.py -> build/lib/bs4/tests copying bs4/tests/test_htmlparser.py -> build/lib/bs4/tests copying bs4/tests/test_docs.py -> build/lib/bs4/tests copying bs4/tests/test_soup.py -> build/lib/bs4/tests copying bs4/tests/__init__.py -> build/lib/bs4/tests copying bs4/tests/test_tree.py -> build/lib/bs4/tests creating build/lib/bs4/builder copying bs4/builder/_htmlparser.py -> build/lib/bs4/builder copying bs4/builder/_lxml.py -> build/lib/bs4/builder copying bs4/builder/_html5lib.py -> build/lib/bs4/builder copying bs4/builder/__init__.py -> build/lib/bs4/builder Fixing build/lib/bs4/testing.py build/lib/bs4/dammit.py build/lib/bs4/element.py build/lib/bs4/__init__.py build/lib/bs4/formatter.py build/lib/bs4/diagnose.py build/lib/bs4/tests/test_builder_registry.py build/lib/bs4/tests/test_html5lib.py build/lib/bs4/tests/test_lxml.py build/lib/bs4/tests/test_htmlparser.py build/lib/bs4/tests/test_docs.py build/lib/bs4/tests/test_soup.py build/lib/bs4/tests/__init__.py build/lib/bs4/tests/test_tree.py build/lib/bs4/builder/_htmlparser.py build/lib/bs4/builder/_lxml.py build/lib/bs4/builder/_html5lib.py build/lib/bs4/builder/__init__.py Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma Fixing build/lib/bs4/testing.py build/lib/bs4/dammit.py build/lib/bs4/element.py build/lib/bs4/__init__.py build/lib/bs4/formatter.py build/lib/bs4/diagnose.py build/lib/bs4/tests/test_builder_registry.py build/lib/bs4/tests/test_html5lib.py build/lib/bs4/tests/test_lxml.py build/lib/bs4/tests/test_htmlparser.py build/lib/bs4/tests/test_docs.py build/lib/bs4/tests/test_soup.py build/lib/bs4/tests/__init__.py build/lib/bs4/tests/test_tree.py build/lib/bs4/builder/_htmlparser.py build/lib/bs4/builder/_lxml.py build/lib/bs4/builder/_html5lib.py build/lib/bs4/builder/__init__.py Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma phase `build' succeeded after 15.5 seconds starting phase `install' running "python setup.py" with command "install" and parameters ("--prefix=/gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3" "--single-version-externally-managed" "--root=/") running install running build running build_py running install_lib creating /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3 creating /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib creating /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8 creating /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages creating /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4 copying build/lib/bs4/testing.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4 copying build/lib/bs4/dammit.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4 copying build/lib/bs4/element.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4 copying build/lib/bs4/__init__.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4 copying build/lib/bs4/formatter.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4 creating /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests copying build/lib/bs4/tests/test_builder_registry.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests copying build/lib/bs4/tests/test_html5lib.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests copying build/lib/bs4/tests/test_lxml.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests copying build/lib/bs4/tests/test_htmlparser.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests copying build/lib/bs4/tests/test_docs.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests copying build/lib/bs4/tests/test_soup.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests copying build/lib/bs4/tests/__init__.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests copying build/lib/bs4/tests/test_tree.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests creating /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder copying build/lib/bs4/builder/_htmlparser.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder copying build/lib/bs4/builder/_lxml.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder copying build/lib/bs4/builder/_html5lib.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder copying build/lib/bs4/builder/__init__.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder copying build/lib/bs4/diagnose.py -> /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4 byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/testing.py to testing.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/dammit.py to dammit.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/element.py to element.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/__init__.py to __init__.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/formatter.py to formatter.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests/test_builder_registry.py to test_builder_registry.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests/test_html5lib.py to test_html5lib.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests/test_lxml.py to test_lxml.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests/test_htmlparser.py to test_htmlparser.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests/test_docs.py to test_docs.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests/test_soup.py to test_soup.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests/__init__.py to __init__.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/tests/test_tree.py to test_tree.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder/_htmlparser.py to _htmlparser.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder/_lxml.py to _lxml.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder/_html5lib.py to _html5lib.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/builder/__init__.py to __init__.cpython-38.pyc byte-compiling /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/bs4/diagnose.py to diagnose.cpython-38.pyc running install_egg_info running egg_info writing beautifulsoup4.egg-info/PKG-INFO writing dependency_links to beautifulsoup4.egg-info/dependency_links.txt writing requirements to beautifulsoup4.egg-info/requires.txt writing top-level names to beautifulsoup4.egg-info/top_level.txt reading manifest file 'beautifulsoup4.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'beautifulsoup4.egg-info/SOURCES.txt' Copying beautifulsoup4.egg-info to /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/lib/python3.8/site-packages/beautifulsoup4-4.9.3-py3.8.egg-info running install_scripts phase `install' succeeded after 2.0 seconds starting phase `wrap' find-files: /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/bin: No such file or directory find-files: /gnu/store/p6a5abkppxggfxwbjm8cnqyqg7c2ya8g-python-beautifulsoup4-4.9.3/sbin: No such file or directory phase `wrap' succeeded after 0.0 seconds starting phase `check' About to destroy and rebuild the py3k/bs4 directory. If you've got stuff in there, Ctrl-C out of this script or answer 'n'. rm: remove 1 argument recursively? RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Refactored py3k/bs4/__init__.py RefactoringTool: Refactored py3k/bs4/dammit.py --- py3k/bs4/__init__.py (original) +++ py3k/bs4/__init__.py (refactored) @@ -51,7 +51,7 @@ # The very first thing we do is give a useful error if someone is # running this code under Python 3 without converting it. -'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>'You need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).' +'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'!='You need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).' # Define some custom warnings. class GuessedAtParserWarning(UserWarning): @@ -100,7 +100,7 @@ # Since BeautifulSoup subclasses Tag, it's possible to treat it as # a Tag with a .name. This name makes it clear the BeautifulSoup # object isn't a real markup tag. - ROOT_TAG_NAME = u'[document]' + ROOT_TAG_NAME = '[document]' # If the end-user gives no indication which tree builder they # want, look for one with these features. @@ -217,7 +217,7 @@ from_encoding = from_encoding or deprecated_argument( "fromEncoding", "from_encoding") - if from_encoding and isinstance(markup, unicode): + if from_encoding and isinstance(markup, str): warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.") from_encoding = None @@ -234,7 +234,7 @@ builder_class = builder builder = None elif builder is None: - if isinstance(features, basestring): + if isinstance(features, str): features = [features] if features is None or len(features) == 0: features = self.DEFAULT_BUILDER_FEATURES @@ -309,13 +309,13 @@ markup = markup.read() elif len(markup) <= 256 and ( (isinstance(markup, bytes) and not b'<' in markup) - or (isinstance(markup, unicode) and not u'<' in markup) + or (isinstance(markup, str) and not '<' in markup) ): # Print out warnings for a couple beginner problems # involving passing non-markup to Beautiful Soup. # Beautiful Soup will still parse the input as markup, # just in case that's what the user really wants. - if (isinstance(markup, unicode) + if (isinstance(markup, str) and not os.path.supports_unicode_filenames): possible_filename = markup.encode("utf8") else: @@ -323,7 +323,7 @@ is_file = False try: is_file = os.path.exists(possible_filename) - except Exception, e: + except Exception as e: # This is almost certainly a problem involving # characters not valid in filenames on this # system. Just let it go. @@ -353,9 +353,9 @@ pass if not success: - other_exceptions = [unicode(e) for e in rejections] + other_exceptions = [str(e) for e in rejections] raise ParserRejectedMarkup( - u"The markup you provided was rejected by the parser. Trying a different parser or a different encoding may help.\n\nOriginal exception(s) from parser:\n " + "\n ".join(other_exceptions) + "The markup you provided was rejected by the parser. Trying a different parser or a different encoding may help.\n\nOriginal exception(s) from parser:\n " + "\n ".join(other_exceptions) ) # Clear out the markup and remove the builder's circular @@ -406,9 +406,9 @@ if isinstance(markup, bytes): space = b' ' cant_start_with = (b"http:", b"https:") - elif isinstance(markup, unicode): - space = u' ' - cant_start_with = (u"http:", u"https:") + elif isinstance(markup, str): + space = ' ' + cant_start_with = ("http:", "https:") else: return @@ -545,7 +545,7 @@ containerClass = self.string_container(containerClass) if self.current_data: - current_data = u''.join(self.current_data) + current_data = ''.join(self.current_data) # If whitespace is not preserved, and this string contains # nothing but ASCII spaces, replace it with a single space # or newline. @@ -748,9 +748,9 @@ eventual_encoding = None if eventual_encoding != None: encoding_part = ' encoding="%s"' % eventual_encoding - prefix = u'\n' % encoding_part + prefix = '\n' % encoding_part else: - prefix = u'' + prefix = '' if not pretty_print: indent_level = None else: @@ -788,4 +788,4 @@ if __name__ == '__main__': import sys soup = BeautifulSoup(sys.stdin) - print(soup.prettify()) + print((soup.prettify())) --- py3k/bs4/dammit.py (original) +++ py3k/bs4/dammit.py (refactored) @@ -10,7 +10,7 @@ __license__ = "MIT" import codecs -from htmlentitydefs import codepoint2name +from html.entities import codepoint2name import re import logging import string @@ -22,7 +22,7 @@ # PyPI package: cchardet import cchardet def chardet_dammit(s): - if isinstance(s, unicode): + if isinstance(s, str): return None return cchardet.detect(s)['encoding'] except ImportError: @@ -32,7 +32,7 @@ # PyPI package: chardet import chardet def chardet_dammit(s): - if isinstance(s, unicode): + if isinstance(s, str): return None return chardet.detect(s)['encoding'] #import chardet.constants @@ -53,14 +53,14 @@ # Build bytestring and Unicode versions of regular expressions for finding # a declared encoding inside an XML or HTML document. -xml_encoding = u'^\\s*<\\?.*encoding=[\'"](.*?)[\'"].*\\?>' -html_meta = u'<\\s*meta[^>]+charset\\s*=\\s*["\']?([^>]*?)[ /;\'">]' +xml_encoding = '^\\s*<\\?.*encoding=[\'"](.*?)[\'"].*\\?>' +html_meta = '<\\s*meta[^>]+charset\\s*=\\s*["\']?([^>]*?)[ /;\'">]' encoding_res = dict() encoding_res[bytes] = { 'html' : re.compile(html_meta.encode("ascii"), re.I), 'xml' : re.compile(xml_encoding.encode("ascii"), re.I), } -encoding_res[unicode] = { +encoding_res[str] = { 'html' : re.compile(html_meta, re.I), 'xml' : re.compile(xml_encoding, re.I) } @@ -80,7 +80,7 @@ # entities, but that's a little tricky. extra = [(39, 'apos')] for codepoint, name in list(codepoint2name.items()) + extra: - character = unichr(codepoint) + character = chr(codepoint) if codepoint not in (34, 39): # There's no point in turning the quotation mark into # " or the single quote into ', unless it @@ -323,7 +323,7 @@ :return: A 2-tuple (modified data, implied encoding) """ encoding = None - if isinstance(data, unicode): + if isinstance(data, str): # Unicode data cannot have a byte-order mark. return data, encoding if (len(data) >= 4) and (data[:2] == b'\xfe\xff') \ @@ -370,7 +370,7 @@ if isinstance(markup, bytes): res = encoding_res[bytes] else: - res = encoding_res[unicode] + res = encoding_res[str] xml_re = res['xml'] html_re = res['html'] @@ -431,9 +431,9 @@ markup, override_encodings, is_html, exclude_encodings) # Short-circuit if the data is in Unicode to begin with. - if isinstance(markup, unicode) or markup == '': + if isinstance(markup, str) or markup == '': self.markup = markup - self.unicode_markup = unicode(markup) + self.unicode_markup = str(markup)RefactoringTool: Refactored py3k/bs4/diagnose.py RefactoringTool: Refactored py3k/bs4/element.py self.original_encoding = None return @@ -523,7 +523,7 @@ :param encoding: The name of an encoding. """ - return unicode(data, encoding, errors) + return str(data, encoding, errors) @property def declared_html_encoding(self): --- py3k/bs4/diagnose.py (original) +++ py3k/bs4/diagnose.py (refactored) @@ -4,8 +4,8 @@ __license__ = "MIT" import cProfile -from StringIO import StringIO -from HTMLParser import HTMLParser +from io import StringIO +from html.parser import HTMLParser import bs4 from bs4 import BeautifulSoup, __version__ from bs4.builder import builder_registry @@ -25,8 +25,8 @@ :param data: A string containing markup that needs to be explained. :return: None; diagnostics are printed to standard output. """ - print("Diagnostic running on Beautiful Soup %s" % __version__) - print("Python version %s" % sys.version) + print(("Diagnostic running on Beautiful Soup %s" % __version__)) + print(("Python version %s" % sys.version)) basic_parsers = ["html.parser", "html5lib", "lxml"] for name in basic_parsers: @@ -35,16 +35,16 @@ break else: basic_parsers.remove(name) - print( + print(( "I noticed that %s is not installed. Installing it may help." % - name) + name)) if 'lxml' in basic_parsers: basic_parsers.append("lxml-xml") try: from lxml import etree - print("Found lxml version %s" % ".".join(map(str,etree.LXML_VERSION))) - except ImportError, e: + print(("Found lxml version %s" % ".".join(map(str,etree.LXML_VERSION)))) + except ImportError as e: print( "lxml is not installed or couldn't be imported.") @@ -52,21 +52,21 @@ if 'html5lib' in basic_parsers: try: import html5lib - print("Found html5lib version %s" % html5lib.__version__) - except ImportError, e: + print(("Found html5lib version %s" % html5lib.__version__)) + except ImportError as e: print( "html5lib is not installed or couldn't be imported.") if hasattr(data, 'read'): data = data.read() elif data.startswith("http:") or data.startswith("https:"): - print('"%s" looks like a URL. Beautiful Soup is not an HTTP client.' % data) + print(('"%s" looks like a URL. Beautiful Soup is not an HTTP client.' % data)) print("You need to use some other library to get the document behind the URL, and feed that document to Beautiful Soup.") return else: try: if os.path.exists(data): - print('"%s" looks like a filename. Reading data from the file.' % data) + print(('"%s" looks like a filename. Reading data from the file.' % data)) with open(data) as fp: data = fp.read() except ValueError: @@ -76,19 +76,19 @@ print("") for parser in basic_parsers: - print("Trying to parse your markup with %s" % parser) + print(("Trying to parse your markup with %s" % parser)) success = False try: soup = BeautifulSoup(data, features=parser) success = True - except Exception, e: - print("%s could not parse the markup." % parser) + except Exception as e: + print(("%s could not parse the markup." % parser)) traceback.print_exc() if success: - print("Here's what %s did with the markup:" % parser) - print(soup.prettify()) - - print("-" * 80) + print(("Here's what %s did with the markup:" % parser)) + print((soup.prettify())) + + print(("-" * 80)) def lxml_trace(data, html=True, **kwargs): """Print out the lxml events that occur during parsing. @@ -104,7 +104,7 @@ """ from lxml import etree for event, element in etree.iterparse(StringIO(data), html=html, **kwargs): - print("%s, %4s, %s" % (event, element.tag, element.text)) + print(("%s, %4s, %s" % (event, element.tag, element.text))) class AnnouncingParser(HTMLParser): """Subclass of HTMLParser that announces parse events, without doing @@ -193,9 +193,9 @@ def benchmark_parsers(num_elements=100000): """Very basic head-to-head performance benchmark.""" - print("Comparative parser benchmark on Beautiful Soup %s" % __version__) + print(("Comparative parser benchmark on Beautiful Soup %s" % __version__)) data = rdoc(num_elements) - print("Generated a large invalid HTML document (%d bytes)." % len(data)) + print(("Generated a large invalid HTML document (%d bytes)." % len(data))) for parser in ["lxml", ["lxml", "html"], "html5lib", "html.parser"]: success = False @@ -204,24 +204,24 @@ soup = BeautifulSoup(data, parser) b = time.time() success = True - except Exception, e: - print("%s could not parse the markup." % parser) + except Exception as e: + print(("%s could not parse the markup." % parser)) traceback.print_exc() if success: - print("BS4+%s parsed the markup in %.2fs." % (parser, b-a)) + print(("BS4+%s parsed the markup in %.2fs." % (parser, b-a))) from lxml import etree a = time.time() etree.HTML(data) b = time.time() - print("Raw lxml parsed the markup in %.2fs." % (b-a)) + print(("Raw lxml parsed the markup in %.2fs." % (b-a))) import html5lib parser = html5lib.HTMLParser() a = time.time() parser.parse(data) b = time.time() - print("Raw html5lib parsed the markup in %.2fs." % (b-a)) + print(("Raw html5lib parsed the markup in %.2fs." % (b-a))) def profile(num_elements=100000, parser="lxml"): """Use Python's profiler on a randomly generated document.""" --- py3k/bs4/element.py (original) +++ py3k/bs4/element.py (refactored) @@ -3,14 +3,14 @@ try: from collections.abc import Callable # Python 3.6 -except ImportError , e: +except ImportError as e: from collections import Callable import re import sys import warnings try: import soupsieve -except ImportError, e: +except ImportError as e: soupsieve = None warnings.warn( 'The soupsieve package is not installed. CSS selectors cannot be used.' @@ -57,22 +57,22 @@ # Source: # https://docs.python.org/3/library/codecs.html#python-specific-encodings PYTHON_SPECIFIC_ENCODINGS = set([ - u"idna", - u"mbcs", - u"oem", - u"palmos", - u"punycode", - u"raw_unicode_escape", - u"undefined", - u"unicode_escape", - u"raw-unicode-escape", - u"unicode-escape", - u"string-escape", - u"string_escape", + "idna", + "mbcs", + "oem", + "palmos", + "punycode", + "raw_unicode_escape", + "undefined", + "unicode_escape", + "raw-unicode-escape", + "unicode-escape", + "string-escape", + "string_escape", ]) -class NamespacedAttribute(unicode): +class NamespacedAttribute(str): """A namespaced string (e.g. 'xml:lang') that remembers the namespace ('xml') and the name ('lang') that were used to create it. """ @@ -84,18 +84,18 @@ name = None if name is None: - obj = unicode.__new__(cls, prefix) + obj = str.__new__(cls, prefix) elif prefix is None: # Not really namespaced. - obj = unicode.__new__(cls, name) + obj = str.__new__(cls, name) else: - obj = unicode.__new__(cls, prefix + ":" + name) + obj = str.__new__(cls, prefix + ":" + name) obj.prefix = prefix obj.name = name obj.namespace = namespace return obj -class AttributeValueWithCharsetSubstitution(unicode): +class AttributeValueWithCharsetSubstitution(str): """A stand-in object for a character encoding specified in HTML.""" class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution): @@ -106,7 +106,7 @@ """ def __new__(cls, original_value): - obj = unicode.__new__(cls, original_value) + obj = str.__new__(cls, original_value) obj.original_value = original_value return obj @@ -134,9 +134,9 @@ match = cls.CHARSET_RE.search(original_value) if match is None: # No substitution necessary. - return unicode.__new__(unicode, original_value) - - obj = unicode.__new__(cls, original_value) + return str.__new__(str, original_value) + + obj = str.__new__(cls, original_value) obj.original_value = original_value return obj @@ -376,7 +376,7 @@ raise ValueError("Cannot insert None into a tag.") if new_child is self: raise ValueError("Cannot insert a tag into itself.") - if (isinstance(new_child, basestring) + if (isinstance(new_child, str) and not isinstance(new_child, NavigableString)): new_child = NavigableString(new_child) @@ -753,7 +753,7 @@ result = (element for element in generator if isinstance(element, Tag)) return ResultSet(strainer, result) - elif isinstance(name, basestring): + elif isinstance(name, str): # Optimization to find all tags with a given name. if name.count(':') == 1: # This is a name with a prefix. If this is a namespace-aware document, @@ -872,7 +872,7 @@ return self.parents -class NavigableString(unicode, PageElement): +class NavigableString(str, PageElement): """A Python Unicode string that is part of a parse tree. When Beautiful Soup parses the markup penguin, it will @@ -895,10 +895,10 @@ passed in to the superclass's __new__ or the superclass won't know how to handle non-ASCII characters. """ - if isinstance(value, unicode): - u = unicode.__new__(cls, value) + if isinstance(value, str): + u = str.__new__(cls, value) else: - u = unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING) + u = str.__new__(cls, value, DEFAULT_OUTPUT_ENCODING) u.setup() return u @@ -909,7 +909,7 @@ return type(self)(self) def __getnewargs__(self): - return (unicode(self),) + return (str(self),) def __getattr__(self, attr): """text.string gives you text. This is for backwards @@ -975,30 +975,30 @@ class CData(PreformattedString): """A CDATA block.""" - PREFIX = u'' + PREFIX = '' class ProcessingInstruction(PreformattedString): """A SGML processing instruction.""" - PREFIX = u'' - SUFFIX = u'>' + PREFIX = '' + SUFFIX = '>' class XMLProcessingInstruction(ProcessingInstruction): """An XML processing instruction.""" - PREFIX = u'' - SUFFIX = u'?>' + PREFIX = '' + SUFFIX = '?>' class Comment(PreformattedString): """An HTML or XML comment.""" - PREFIX = u'' + PREFIX = '' class Declaration(PreformattedString): """An XML declaration.""" - PREFIX = u'' - SUFFIX = u'?>' + PREFIX = '' + SUFFIX = '?>' class Doctype(PreformattedString): @@ -1026,8 +1026,8 @@ return Doctype(value) - PREFIX = u'\n' + PREFIX = '\n' class Stylesheet(NavigableString): @@ -1263,7 +1263,7 @@ for string in self._all_strings(True): yield string - def get_text(self, separator=u"", strip=False, + def get_text(self, separator="", strip=False, types=(NavigableString, CData)): """Get all child strings, concatenated using the given separator. @@ -1416,7 +1416,7 @@ def __contains__(self, x): return x in self.contents - def __nonzero__(self): + def __bool__(self): "A tag is non-None even if it has no contents." return True @@ -1565,8 +1565,8 @@ else: if isinstance(val, list) or isinstance(val, tuple): val = ' '.join(val) - elif not isinstance(val, basestring): - val = unicode(val) + elif not isinstance(val, str): + val = str(val) elif ( isinstance(val, AttributeValueWithCharsetSubstitution) and eventual_encoding is not None @@ -1575,7 +1575,7 @@ text = formatter.attribute_value(val) decoded = ( - unicode(key) + '=' + str(key) + '=' + formatter.quoted_attribute_value(text)) attrs.append(decoded) close = '' @@ -1934,7 +1934,7 @@ else: attrs = kwargs normalized_attrs = {} - for key, value in attrs.items(): + for key, value in list(attrs.items()): normalized_attrs[key] = self._normalize_search_value(value) self.attrs = normalized_attrs @@ -1943,7 +1943,7 @@ def _normalize_search_value(self, value): # Leave it alone if it's a Unicode string, a callable, a # regular expression, a boolean, or None. - if (isinstance(value, unicode) or isinstance(value, Callable) or hasattr(value, 'match') + if (isinstance(value, str) or isinstance(value, Callable) or hasattr(value, 'match') or isinstance(value, bool) or value is None): return value @@ -1956,7 +1956,7 @@ new_value = [] for v in value: if (hasattr(v, '__iter__') and not isinstance(v, bytes) - and not isinstance(v, unicode)): + and not isinstance(v, str)): # This is almost certainly the user's mistake. In the # interests of avoiding infinite loops, we'll let # it through as-is rather than doing a recursive call. @@ -1968,7 +1968,7 @@ # Otherwise, convert it into a Unicode string. # The unicode(str()) thing is so this will do the same thing on Python 2 # and Python 3. - return unicode(str(value)) + return str(str(value)) def __str__(self): """A human-readable representation of this SoupStrainer.""" @@ -1996,7 +1996,7 @@ markup = markup_name markup_attrs = markup - if isinstance(self.name, basestring): + if isinstance(self.name, str): # Optimization for a very common case where the user is # searching for a tag with one specific name, and we're # looking at a tag with a different name. @@ -2052,7 +2052,7 @@ found = None # If given a list of items, scan it for a text element that # matches. - if hasattr(markup, '__iter__') and not isinstance(markup, (Tag, basestring)): + if hasattr(markup, '__iter__') and not isinstance(markup, (Tag, str)): for element in markup: if isinstance(element, NavigableString) \ and self.search(element): @@ -2065,7 +2065,7 @@ found = self.search_tag(markup) # If it's text, make sure the text matches. elif isinstance(markup, NavigableString) or \ - isinstance(markup, basestring): + isinstance(markup, str): if not self.name and not self.attrs and self._matches(markup, self.text): found = markup else: @@ -2110,7 +2110,7 @@ return not match_against if (hasattr(match_against, '__iter__') - and not isinstance(match_against, basestring)): + and not isinstance(match_against, str)): # We're asked to match against an iterable of items. # The markup must be match at least one item in the # iterable. We'll try each one in turn.RefactoringTool: Refactored py3k/bs4/formatter.py RefactoringTool: Refactored py3k/bs4/testing.py @@ -2137,7 +2137,7 @@ # the tag's name and once against its prefixed name. match = False - if not match and isinstance(match_against, unicode): + if not match and isinstance(match_against, str): # Exact string match match = markup == match_against --- py3k/bs4/formatter.py (original) +++ py3k/bs4/formatter.py (refactored) @@ -83,7 +83,7 @@ """ if not self.entity_substitution: return ns - from element import NavigableString + from .element import NavigableString if (isinstance(ns, NavigableString) and ns.parent is not None and ns.parent.name in self.cdata_containing_tags): --- py3k/bs4/testing.py (original) +++ py3k/bs4/testing.py (refactored) @@ -25,7 +25,7 @@ from bs4.builder import HTMLParserTreeBuilder default_builder = HTMLParserTreeBuilder -BAD_DOCUMENT = u"""A bare string +BAD_DOCUMENT = """A bare string
@@ -94,7 +94,7 @@ # Verify that every tag that was opened was eventually closed. # There are no tags in the open tag counter. - assert all(v==0 for v in obj.open_tag_counter.values()) + assert all(v==0 for v in list(obj.open_tag_counter.values())) # The only tag in the tag stack is the one for the root # document. @@ -372,7 +372,7 @@ # process_markup correctly sets processing_instruction_class # even when the markup is already Unicode and there is no # need to process anything. - markup = u"""""" + markup = """""" soup = self.soup(markup) self.assertEqual(markup, soup.decode()) @@ -544,14 +544,14 @@ # "&T" and "&p" look like incomplete character entities, but they are # not. self.assertSoupEquals( - u"• AT&T is in the s&p 500
", - u"\u2022 AT&T is in the s&p 500
" + "• AT&T is in the s&p 500
", + "\u2022 AT&T is in the s&p 500
" ) def test_apos_entity(self): self.assertSoupEquals( - u"Bob's Bar
", - u"Bob's Bar
", + "Bob's Bar
", + "Bob's Bar
", ) def test_entities_in_foreign_document_encoding(self): @@ -564,17 +564,17 @@ # characters. markup = "Hello -☃
" soup = self.soup(markup) - self.assertEquals(u"“Hello” -☃", soup.p.string) + self.assertEqual("“Hello” -☃", soup.p.string) def test_entities_in_attributes_converted_to_unicode(self): - expect = u'' + expect = '' self.assertSoupEquals('', expect) self.assertSoupEquals('', expect) self.assertSoupEquals('', expect) self.assertSoupEquals('', expect) def test_entities_in_text_converted_to_unicode(self): - expect = u'pi\N{LATIN SMALL LETTER N WITH TILDE}ata
' + expect = 'pi\N{LATIN SMALL LETTER N WITH TILDE}ata
' self.assertSoupEquals("piñata
", expect) self.assertSoupEquals("piñata
", expect) self.assertSoupEquals("piñata
", expect) @@ -585,7 +585,7 @@ 'I said "good day!"
') def test_out_of_range_entity(self): - expect = u"\N{REPLACEMENT CHARACTER}" + expect = "\N{REPLACEMENT CHARACTER}" self.assertSoupEquals("", expect) self.assertSoupEquals("", expect) self.assertSoupEquals("", expect) @@ -663,9 +663,9 @@ # A seemingly innocuous document... but it's in Unicode! And # it contains characters that can't be represented in the # encoding found in the declaration! The horror! - markup = u'Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!' - soup = self.soup(markup) - self.assertEqual(u'Sacr\xe9 bleu!', soup.body.string) + markup = 'Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!' + soup = self.soup(markup) + self.assertEqual('Sacr\xe9 bleu!', soup.body.string) def test_soupstrainer(self): """Parsers should be able to work with SoupStrainers.""" @@ -705,7 +705,7 @@ # Both XML and HTML entities are converted to Unicode characters # during parsing. text = "<<sacré bleu!>>
" - expected = u"<<sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>
" + expected = "<<sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>
" self.assertSoupEquals(text, expected) def test_smart_quotes_converted_on_the_way_in(self): @@ -715,15 +715,15 @@ soup = self.soup(quote) self.assertEqual( soup.p.string, - u"\N{LEFT SINGLE QUOTATION MARK}Foo\N{RIGHT SINGLE QUOTATION MARK}") + "\N{LEFT SINGLE QUOTATION MARK}Foo\N{RIGHT SINGLE QUOTATION MARK}") def test_non_breaking_spaces_converted_on_the_way_in(self): soup = self.soup(" ") - self.assertEqual(soup.a.string, u"\N{NO-BREAK SPACE}" * 2) + self.assertEqual(soup.a.string, "\N{NO-BREAK SPACE}" * 2) def test_entities_converted_on_the_way_out(self): text = "<<sacré bleu!>>
" - expected = u"<<sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>
".encode("utf-8") + expected = "<<sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>
".encode("utf-8") soup = self.soup(text) self.assertEqual(soup.p.encode("utf-8"), expected) @@ -732,7 +732,7 @@ # easy-to-understand document. # Here it is in Unicode. Note that it claims to be in ISO-Latin-1. - unicode_html = u'Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!
' + unicode_html = 'Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!
' # That's because we're going to encode it into ISO-Latin-1, and use # that to test. @@ -848,8 +848,8 @@ soup = self.soup(markup) for encoding in PYTHON_SPECIFIC_ENCODINGS: if encoding in ( - u'idna', u'mbcs', u'oem', u'undefined', - u'string_escape', u'string-escape' + 'idna', 'mbcs', 'oem', 'undefined', + 'string_escape', 'string-escape' ): # For one reason or another, these will raise an # exception if we actually try to use them, so don't @@ -910,8 +910,8 @@ soup = self.soup(markup) for encoding in PYTHON_SPECIFIC_ENCODINGS: if encoding in ( - u'idna', u'mbcs', u'oem', u'undefined', - u'string_escape', u'string-escape' + 'idna', 'mbcs', 'oem', 'undefined', + 'string_escape', 'string-escape' ): # For one reason or another, these will raise an # exception if we actually try to use them, so don't @@ -962,15 +962,15 @@ self.assertTrue(b"< < hey > >" in encoded) def test_can_parse_unicode_document(self): - markup = u'foo
\n' soup = self.soup(markup) - self.assertEqual(u"foo
\n", soup.body.decode()) + self.assertEqual("foo
\n", soup.body.decode()) self.assertEqual(2, len(soup.find_all('p'))) def test_reparented_markup_ends_with_whitespace(self): markup = 'foo
\n\n' soup = self.soup(markup) - self.assertEqual(u"foo
\n\n", soup.body.decode()) + self.assertEqual("foo
\n\n", soup.body.decode()) self.assertEqual(2, len(soup.find_all('p'))) def test_reparented_markup_containing_identical_whitespace_nodes(self): @@ -127,7 +127,7 @@ def test_foster_parenting(self): markup = b"""A"""
soup = self.soup(markup)
- self.assertEqual(u"Aéé" + data = "éé" soup = self.soup(data) - self.assertEqual(u"éé", soup.h1.string) + self.assertEqual("éé", soup.h1.string) def test_embedded_null(self): - data = u"foo\0bar" + data = "foo\0bar" soup = self.soup(data) - self.assertEqual(u"foo\0bar", soup.h1.string) + self.assertEqual("foo\0bar", soup.h1.string) def test_exclude_encodings(self): - utf8_data = u"Räksmörgås".encode("utf-8") + utf8_data = "Räksmörgås".encode("utf-8") soup = self.soup(utf8_data, exclude_encodings=["utf-8"]) self.assertEqual("windows-1252", soup.original_encoding) @@ -127,7 +127,7 @@ yield markup, None, None, False import re - self.assertRaisesRegexp( + self.assertRaisesRegex( ParserRejectedMarkup, "The markup you provided was rejected by the parser. Trying a different parser or a different encoding may help.", BeautifulSoup, '', builder=Mock, @@ -303,7 +303,7 @@ with warnings.catch_warnings(record=True) as warning_list: # note - this url must differ from the bytes one otherwise # python's warnings system swallows the second warning - soup = self.soup(u"http://www.crummyunicode.com/") + soup = self.soup("http://www.crummyunicode.com/") warning = self._assert_warning( warning_list, MarkupResemblesLocatorWarning ) @@ -319,7 +319,7 @@ def test_url_warning_with_unicode_and_space(self): with warnings.catch_warnings(record=True) as warning_list: - soup = self.soup(u"http://www.crummyuncode.com/ is great") + soup = self.soup("http://www.crummyuncode.com/ is great") self.assertFalse(any("looks like a URL" in str(w.message) for w in warning_list)) @@ -341,9 +341,9 @@ def test_simple_html_substitution(self): # Unicode characters corresponding to named HTML entites # are substituted, and no others. - s = u"foo\u2200\N{SNOWMAN}\u00f5bar" + s = "foo\u2200\N{SNOWMAN}\u00f5bar" self.assertEqual(self.sub.substitute_html(s), - u"foo∀\N{SNOWMAN}õbar") + "foo∀\N{SNOWMAN}õbar") def test_smart_quote_substitution(self): # MS smart quotes are a common source of frustration, so we @@ -408,7 +408,7 @@ def setUp(self): super(TestEncodingConversion, self).setUp() - self.unicode_data = u'Räksmörgås') - self.assertEqual(soup.find(string=u'Räksmörgås'), u'Räksmörgås') + soup = self.soup('Räksmörgås') + self.assertEqual(soup.find(string='Räksmörgås'), 'Räksmörgås') def test_unicode_attribute_find(self): - soup = self.soup(u'here it is') + soup = self.soup('here it is') str(soup) - self.assertEqual("here it is", soup.find(id=u'Räksmörgås').text) + self.assertEqual("here it is", soup.find(id='Räksmörgås').text) def test_find_everything(self): @@ -101,17 +101,17 @@ """You can search the tree for text nodes.""" soup = self.soup("Foobar\xbb") # Exact match. - self.assertEqual(soup.find_all(string="bar"), [u"bar"]) - self.assertEqual(soup.find_all(text="bar"), [u"bar"]) + self.assertEqual(soup.find_all(string="bar"), ["bar"]) + self.assertEqual(soup.find_all(text="bar"), ["bar"]) # Match any of a number of strings. self.assertEqual( - soup.find_all(text=["Foo", "bar"]), [u"Foo", u"bar"]) + soup.find_all(text=["Foo", "bar"]), ["Foo", "bar"]) # Match a regular expression. self.assertEqual(soup.find_all(text=re.compile('.*')), - [u"Foo", u"bar", u'\xbb']) + ["Foo", "bar", '\xbb']) # Match anything. self.assertEqual(soup.find_all(text=True), - [u"Foo", u"bar", u'\xbb']) + ["Foo", "bar", '\xbb']) def test_find_all_limit(self): """You can limit the number of items returned by find_all.""" @@ -254,8 +254,8 @@ ["Matching a.", "Matching b."]) def test_find_all_by_utf8_attribute_value(self): - peace = u"םולש".encode("utf8") - data = u''.encode("utf8") + peace = "םולש".encode("utf8") + data = ''.encode("utf8") soup = self.soup(data) self.assertEqual([soup.a], soup.find_all(title=peace)) self.assertEqual([soup.a], soup.find_all(title=peace.decode("utf8"))) @@ -444,7 +444,7 @@ # output. # Since the tag has two children, its .string is None. - self.assertEquals(None, div.span.string) + self.assertEqual(None, div.span.string) self.assertEqual(7, len(div.contents)) div.smooth() @@ -755,18 +755,18 @@ # No list of whitespace-preserving tags -> pretty-print tag._preserve_whitespace_tags = None - self.assertEquals(True, tag._should_pretty_print(0)) + self.assertEqual(True, tag._should_pretty_print(0)) # List exists but tag is not on the list -> pretty-print tag.preserve_whitespace_tags = ["some_other_tag"] - self.assertEquals(True, tag._should_pretty_print(1)) + self.assertEqual(True, tag._should_pretty_print(1)) # Indent level is None -> don't pretty-print - self.assertEquals(False, tag._should_pretty_print(None)) + self.assertEqual(False, tag._should_pretty_print(None)) # Tag is on the whitespace-preserving list -> don't pretty-print tag.preserve_whitespace_tags = ["some_other_tag", "a_tag"] - self.assertEquals(False, tag._should_pretty_print(1)) + self.assertEqual(False, tag._should_pretty_print(1)) class TestTagCreation(SoupTest): @@ -905,10 +905,10 @@ assert not isinstance(i, BeautifulSoup) p1, p2, p3, p4 = list(soup.children) - self.assertEquals("And now, a word:", p1.string) - self.assertEquals("p2", p2.string) - self.assertEquals("p3", p3.string) - self.assertEquals("And we're back.", p4.string) + self.assertEqual("And now, a word:", p1.string) + self.assertEqual("p2", p2.string) + self.assertEqual("p3", p3.string) + self.assertEqual("And we're back.", p4.string) def test_replace_with_maintains_next_element_throughout(self): @@ -1015,8 +1015,8 @@ d1 = soup.find('div', id='d1') d2 = soup.find('div', id='d2') d2.extend(d1) - self.assertEqual(u'', d1.decode()) - self.assertEqual(u'', d2.decode()) + self.assertEqual('', d1.decode()) + self.assertEqual('', d2.decode()) def test_move_tag_to_beginning_of_parent(self): data = "', 'html.parser') encoding = soup.original_encoding copy = soup.__copy__() - self.assertEqual(u" ", unicode(copy)) + self.assertEqual(" ", str(copy)) self.assertEqual(encoding, copy.original_encoding) def test_copy_preserves_builder_information(self): @@ -1554,14 +1554,14 @@ def test_unicode_pickle(self): # A tree containing Unicode characters can be pickled. - html = u"\N{SNOWMAN}" + html = "\N{SNOWMAN}" soup = self.soup(html) dumped = pickle.dumps(soup, pickle.HIGHEST_PROTOCOL) loaded = pickle.loads(dumped) self.assertEqual(loaded.decode(), soup.decode()) def test_copy_navigablestring_is_not_attached_to_tree(self): - html = u"FooBar" + html = "FooBar" soup = self.soup(html) s1 = soup.find(string="Foo") s2 = copy.copy(s1) @@ -1573,7 +1573,7 @@ self.assertEqual(None, s2.previous_element) def test_copy_navigablestring_subclass_has_same_type(self): - html = u"" + html = "" soup = self.soup(html) s1 = soup.string s2 = copy.copy(s1) @@ -1581,19 +1581,19 @@ self.assertTrue(isinstance(s2, Comment)) def test_copy_entire_soup(self): - html = u"end" + html = "end" soup = self.soup(html) soup_copy = copy.copy(soup) self.assertEqual(soup, soup_copy) def test_copy_tag_copies_contents(self): - html = u"end" + html = "end" soup = self.soup(html) div = soup.div div_copy = copy.copy(div) # The two tags look the same, and evaluate to equal. - self.assertEqual(unicode(div), unicode(div_copy)) + self.assertEqual(str(div), str(div_copy)) self.assertEqual(div, div_copy) # But they're not the same object. @@ -1609,17 +1609,17 @@ class TestSubstitutions(SoupTest): def test_default_formatter_is_minimal(self): - markup = u"<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" + markup = "<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" soup = self.soup(markup) decoded = soup.decode(formatter="minimal") # The < is converted back into < but the e-with-acute is left alone. self.assertEqual( decoded, self.document_for( - u"<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>")) + "<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>")) def test_formatter_html(self): - markup = u" <<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" + markup = " <<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" soup = self.soup(markup) decoded = soup.decode(formatter="html") self.assertEqual( @@ -1627,7 +1627,7 @@ self.document_for(" <<Sacré bleu!>>")) def test_formatter_html5(self): - markup = u" <<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" + markup = " <<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" soup = self.soup(markup) decoded = soup.decode(formatter="html5") self.assertEqual( @@ -1635,49 +1635,49 @@ self.document_for(" <<Sacré bleu!>>")) def test_formatter_minimal(self): - markup = u"<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" + markup = "<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" soup = self.soup(markup) decoded = soup.decode(formatter="minimal") # The < is converted back into < but the e-with-acute is left alone. self.assertEqual( decoded, self.document_for( - u"<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>")) + "<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>")) def test_formatter_null(self): - markup = u"<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" + markup = "<<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>" soup = self.soup(markup) decoded = soup.decode(formatter=None) # Neither the angle brackets nor the e-with-acute are converted. # This is not valid HTML, but it's what the user wanted. self.assertEqual(decoded, - self.document_for(u"< " + markup = "<foo>bar " soup = self.soup(markup) decoded = soup.decode(formatter = lambda x: x.upper()) # Instead of normal entity conversion code, the custom # callable is called on every string. self.assertEqual( decoded, - self.document_for(u" ")) + self.document_for(" ")) def test_formatter_is_run_on_attribute_values(self): - markup = u'e' + markup = 'e' soup = self.soup(markup) a = soup.a - expect_minimal = u'e' + expect_minimal = 'e' self.assertEqual(expect_minimal, a.decode()) self.assertEqual(expect_minimal, a.decode(formatter="minimal"))RefactoringTool: Files that were modified: RefactoringTool: py3k/bs4/__init__.py RefactoringTool: py3k/bs4/dammit.py RefactoringTool: py3k/bs4/diagnose.py RefactoringTool: py3k/bs4/element.py RefactoringTool: py3k/bs4/formatter.py RefactoringTool: py3k/bs4/testing.py RefactoringTool: py3k/bs4/builder/__init__.py RefactoringTool: py3k/bs4/builder/_html5lib.py RefactoringTool: py3k/bs4/builder/_htmlparser.py RefactoringTool: py3k/bs4/builder/_lxml.py RefactoringTool: py3k/bs4/tests/__init__.py RefactoringTool: py3k/bs4/tests/test_builder_registry.py RefactoringTool: py3k/bs4/tests/test_docs.py RefactoringTool: py3k/bs4/tests/test_html5lib.py RefactoringTool: py3k/bs4/tests/test_htmlparser.py RefactoringTool: py3k/bs4/tests/test_lxml.py RefactoringTool: py3k/bs4/tests/test_soup.py RefactoringTool: py3k/bs4/tests/test_tree.py - expect_html = u'e' + expect_html = 'e' self.assertEqual(expect_html, a.decode(formatter="html")) self.assertEqual(markup, a.decode(formatter=None)) - expect_upper = u'E' + expect_upper = 'E' self.assertEqual(expect_upper, a.decode(formatter=lambda x: x.upper())) def test_formatter_skips_script_tag_for_html_documents(self): @@ -1703,7 +1703,7 @@ # Everything outside the tag is reformatted, but everything # inside is left alone. self.assertEqual( - u' |