Title: ParseResultBytes.unsplit() raises AttributeError for a reference without an authority · Issue #163 · python-hyper/rfc3986 · GitHub
Open Graph Title: ParseResultBytes.unsplit() raises AttributeError for a reference without an authority · Issue #163 · python-hyper/rfc3986
X Title: ParseResultBytes.unsplit() raises AttributeError for a reference without an authority · Issue #163 · python-hyper/rfc3986
Description: >>> from rfc3986.parseresult import ParseResult, ParseResultBytes >>> ParseResult.from_string("/a").unsplit() '/a' >>> ParseResultBytes.from_string(b"/a").unsplit() AttributeError: 'NoneType' object has no attribute 'encode' Any referenc...
Open Graph Description: >>> from rfc3986.parseresult import ParseResult, ParseResultBytes >>> ParseResult.from_string("/a").unsplit() '/a' >>> ParseResultBytes.from_string(b"/a").unsplit() AttributeError: 'NoneType' objec...
X Description: >>> from rfc3986.parseresult import ParseResult, ParseResultBytes >>> ParseResult.from_string("/a").unsplit() '/a' >>> ParseResultBytes.from_string(b&qu...
Opengraph URL: https://github.com/python-hyper/rfc3986/issues/163
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ParseResultBytes.unsplit() raises AttributeError for a reference without an authority","articleBody":"```python\n>>> from rfc3986.parseresult import ParseResult, ParseResultBytes\n>>> ParseResult.from_string(\"/a\").unsplit()\n'/a'\n>>> ParseResultBytes.from_string(b\"/a\").unsplit()\nAttributeError: 'NoneType' object has no attribute 'encode'\n```\n\nAny reference without an authority (`/a`, `a`, `mailto:x`, `?q`) crashes the bytes variant, while the str variant round-trips. Reproduced on 2.0.0 (main 3bd3832).\n\nThe traceback: `unsplit` calls `copy_with(lazy_normalize=False)`, which calls `_generate_authority`, which reads the `authority` property, and that property does `self.reference.authority.encode(self.encoding)` (parseresult.py:409) without checking for `None`. The other bytes properties (`scheme`, `path`, …) are guarded the same way `authority` should be.\n\nHappy to send a PR with a test if you would take one.\n","author":{"url":"https://github.com/FengXiao1231","@type":"Person","name":"FengXiao1231"},"datePublished":"2026-10-20T03:00:41Z","url":"https://github.com/python-hyper/rfc3986/issues/163"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a27fbd65-1569-b32a-4c8d-34e9e9a61c3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A624:39FDE1:17E788D:1DEF530:6B026794 |
| html-safe-nonce | e4c61178abb47d9a56b24eecc06590e1e3543606c60b91d03f50eadb451012f2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjI0OjM5RkRFMToxN0U3ODhEOjFERUY1MzA6NkIwMjY3OTQiLCJ2aXNpdG9yX2lkIjoiOTg5NzQxODY5MDMyNDMzNTU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2415061aae4a99a96b202be309e1eaba42668984685db8d6d92a0d1a9f62aca5 |
| hovercard-subject-tag | issue:5935146818 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-hyper/rfc3986/163/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c9d29827cba5ecd912e630ab8c44694d9ed997ef09c9539366867b5f69ae6ed/python-hyper/rfc3986/issues/163 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c9d29827cba5ecd912e630ab8c44694d9ed997ef09c9539366867b5f69ae6ed/python-hyper/rfc3986/issues/163 |
| og:image:alt | >>> from rfc3986.parseresult import ParseResult, ParseResultBytes >>> ParseResult.from_string("/a").unsplit() '/a' >>> ParseResultBytes.from_string(b"/a").unsplit() AttributeError: 'NoneType' objec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | FengXiao1231 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-hyper/rfc3986 git https://github.com/python-hyper/rfc3986.git |
| octolytics-dimension-user_id | 13035907 |
| octolytics-dimension-user_login | python-hyper |
| octolytics-dimension-repository_id | 21205959 |
| octolytics-dimension-repository_nwo | python-hyper/rfc3986 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21205959 |
| octolytics-dimension-repository_network_root_nwo | python-hyper/rfc3986 |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width