René's URL Explorer Experiment


Title: lxml doesn’t like control characters · Issue #96 · html5lib/html5lib-python · GitHub

Open Graph Title: lxml doesn’t like control characters · Issue #96 · html5lib/html5lib-python

X Title: lxml doesn’t like control characters · Issue #96 · html5lib/html5lib-python

Description: Same issue as #33, but with other non-whitespace C0 control characters: U+0001 to U+0008, U+000B, U+000C, U+000E to U+001F. Each of these trigger the exception below: html5lib.parse('

', treebuilder='lxml') html5lib.parse('

\x01'...

Open Graph Description: Same issue as #33, but with other non-whitespace C0 control characters: U+0001 to U+0008, U+000B, U+000C, U+000E to U+001F. Each of these trigger the exception below: html5lib.parse('

', tree...

X Description: Same issue as #33, but with other non-whitespace C0 control characters: U+0001 to U+0008, U+000B, U+000C, U+000E to U+001F. Each of these trigger the exception below: html5lib.parse('<p>&...

Opengraph URL: https://github.com/html5lib/html5lib-python/issues/96

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lxml doesn’t like control characters","articleBody":"Same issue as #33, but with other non-whitespace C0 control characters: U+0001 to U+0008, U+000B, U+000C, U+000E to U+001F.\n\nEach of these trigger the exception below:\n\n```\nhtml5lib.parse('\u003cp\u003e\u0026#1;', treebuilder='lxml')\nhtml5lib.parse('\u003cp\u003e\\x01', treebuilder='lxml')\nhtml5lib.parse('\u003cp id=\"\u0026#1;\"\u003e', treebuilder='lxml')\nhtml5lib.parse('\u003cp id=\"\\x01\"\u003e', treebuilder='lxml')\n```\n\n```\nTraceback (most recent call last):\n  File \"/tmp/a.py\", line 4, in \u003cmodule\u003e\n    html5lib.parse('\u003cp\u003e\u0026#1;', treebuilder='lxml')\n  File \"/home/simon/.virtualenvs/weasyprint/lib/python3.3/site-packages/html5lib/html5parser.py\", line 28, in parse\n    return p.parse(doc, encoding=encoding)\n  File \"/home/simon/.virtualenvs/weasyprint/lib/python3.3/site-packages/html5lib/html5parser.py\", line 224, in parse\n    parseMeta=parseMeta, useChardet=useChardet)\n  File \"/home/simon/.virtualenvs/weasyprint/lib/python3.3/site-packages/html5lib/html5parser.py\", line 93, in _parse\n    self.mainLoop()\n  File \"/home/simon/.virtualenvs/weasyprint/lib/python3.3/site-packages/html5lib/html5parser.py\", line 183, in mainLoop\n    new_token = phase.processCharacters(new_token)\n  File \"/home/simon/.virtualenvs/weasyprint/lib/python3.3/site-packages/html5lib/html5parser.py\", line 991, in processCharacters\n    self.tree.insertText(token[\"data\"])\n  File \"/home/simon/.virtualenvs/weasyprint/lib/python3.3/site-packages/html5lib/treebuilders/_base.py\", line 320, in insertText\n    parent.insertText(data)\n  File \"/home/simon/.virtualenvs/weasyprint/lib/python3.3/site-packages/html5lib/treebuilders/etree_lxml.py\", line 240, in insertText\n    builder.Element.insertText(self, data, insertBefore)\n  File \"/home/simon/.virtualenvs/weasyprint/lib/python3.3/site-packages/html5lib/treebuilders/etree.py\", line 108, in insertText\n    self._element.text += data\n  File \"lxml.etree.pyx\", line 921, in lxml.etree._Element.text.__set__ (src/lxml/lxml.etree.c:41467)\n  File \"apihelpers.pxi\", line 652, in lxml.etree._setNodeText (src/lxml/lxml.etree.c:18888)\n  File \"apihelpers.pxi\", line 1335, in lxml.etree._utf8 (src/lxml/lxml.etree.c:24701)\nValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters\n```\n\nU+000C in text (but not in attribute values) is replaced by U+0020 with a warning:\n\n```\nDataLossWarning: Text cannot contain U+000C\n```\n\nlibxml2’s HTML parser replaces them with nothing, which I slightly prefer. Anyway, this is probably what should happen for every character that lxml doesn’t like.\n","author":{"url":"https://github.com/SimonSapin","@type":"Person","name":"SimonSapin"},"datePublished":"2013-07-22T10:17:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":26},"url":"https://github.com/96/html5lib-python/issues/96"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:57c81935-fc19-49df-4235-462ef36cbdae
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8D24:F89EA:10FEFD3:16C242B:69702A3B
html-safe-nonce9e98ee522ec44a1d9c67f7a2771b583196623c0fe0f845b94a50c57c680ee1ee
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDI0OkY4OUVBOjEwRkVGRDM6MTZDMjQyQjo2OTcwMkEzQiIsInZpc2l0b3JfaWQiOiIxMjg1MDQxODc3MjkxMTE3MTE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0111ffffd19269e51ad136590afcf131235dc89868a3339054b4d3cff6c39315
hovercard-subject-tagissue:17039397
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/html5lib/html5lib-python/96/issue_layout
twitter:imagehttps://opengraph.githubassets.com/24b63c011a604e3dff01c158394e0470133f1615e2e7f2d51844e0d824dbfec0/html5lib/html5lib-python/issues/96
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/24b63c011a604e3dff01c158394e0470133f1615e2e7f2d51844e0d824dbfec0/html5lib/html5lib-python/issues/96
og:image:altSame issue as #33, but with other non-whitespace C0 control characters: U+0001 to U+0008, U+000B, U+000C, U+000E to U+001F. Each of these trigger the exception below: html5lib.parse('

', tree...

og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSimonSapin
hostnamegithub.com
expected-hostnamegithub.com
None01fa379f5de85ef8e791d09724e69709ce9eb9595278316e0a921312dc88e0bc
turbo-cache-controlno-preview
go-importgithub.com/html5lib/html5lib-python git https://github.com/html5lib/html5lib-python.git
octolytics-dimension-user_id4092973
octolytics-dimension-user_loginhtml5lib
octolytics-dimension-repository_id9322649
octolytics-dimension-repository_nwohtml5lib/html5lib-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id9322649
octolytics-dimension-repository_network_root_nwohtml5lib/html5lib-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedda91974c069382b0dfa47b2da7e28bd061c8331
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/html5lib/html5lib-python/issues/96#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhtml5lib%2Fhtml5lib-python%2Fissues%2F96
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhtml5lib%2Fhtml5lib-python%2Fissues%2F96
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=html5lib%2Fhtml5lib-python
Reloadhttps://patch-diff.githubusercontent.com/html5lib/html5lib-python/issues/96
Reloadhttps://patch-diff.githubusercontent.com/html5lib/html5lib-python/issues/96
Reloadhttps://patch-diff.githubusercontent.com/html5lib/html5lib-python/issues/96
html5lib https://patch-diff.githubusercontent.com/html5lib
html5lib-pythonhttps://patch-diff.githubusercontent.com/html5lib/html5lib-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fhtml5lib%2Fhtml5lib-python
Fork 302 https://patch-diff.githubusercontent.com/login?return_to=%2Fhtml5lib%2Fhtml5lib-python
Star 1.2k https://patch-diff.githubusercontent.com/login?return_to=%2Fhtml5lib%2Fhtml5lib-python
Code https://patch-diff.githubusercontent.com/html5lib/html5lib-python
Issues 81 https://patch-diff.githubusercontent.com/html5lib/html5lib-python/issues
Pull requests 12 https://patch-diff.githubusercontent.com/html5lib/html5lib-python/pulls
Discussions https://patch-diff.githubusercontent.com/html5lib/html5lib-python/discussions
Actions https://patch-diff.githubusercontent.com/html5lib/html5lib-python/actions
Projects 0 https://patch-diff.githubusercontent.com/html5lib/html5lib-python/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/html5lib/html5lib-python/security
Please reload this pagehttps://patch-diff.githubusercontent.com/html5lib/html5lib-python/issues/96
Insights https://patch-diff.githubusercontent.com/html5lib/html5lib-python/pulse
Code https://patch-diff.githubusercontent.com/html5lib/html5lib-python
Issues https://patch-diff.githubusercontent.com/html5lib/html5lib-python/issues
Pull requests https://patch-diff.githubusercontent.com/html5lib/html5lib-python/pulls
Discussions https://patch-diff.githubusercontent.com/html5lib/html5lib-python/discussions
Actions https://patch-diff.githubusercontent.com/html5lib/html5lib-python/actions
Projects https://patch-diff.githubusercontent.com/html5lib/html5lib-python/projects
Security https://patch-diff.githubusercontent.com/html5lib/html5lib-python/security
Insights https://patch-diff.githubusercontent.com/html5lib/html5lib-python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/html5lib/html5lib-python/issues/96
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/html5lib/html5lib-python/issues/96
lxml doesn’t like control charactershttps://patch-diff.githubusercontent.com/html5lib/html5lib-python/issues/96#top
https://patch-diff.githubusercontent.com/gsnedders
bughttps://github.com/html5lib/html5lib-python/issues?q=state%3Aopen%20label%3A%22bug%22
parserhttps://github.com/html5lib/html5lib-python/issues?q=state%3Aopen%20label%3A%22parser%22
https://github.com/SimonSapin
https://github.com/SimonSapin
SimonSapinhttps://github.com/SimonSapin
on Jul 22, 2013https://github.com/html5lib/html5lib-python/issues/96#issue-17039397
#33https://github.com/html5lib/html5lib-python/issues/33
gsneddershttps://patch-diff.githubusercontent.com/gsnedders
bughttps://github.com/html5lib/html5lib-python/issues?q=state%3Aopen%20label%3A%22bug%22
parserhttps://github.com/html5lib/html5lib-python/issues?q=state%3Aopen%20label%3A%22parser%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.