{"html_url": "https://github.com/simonw/datasette/issues/1181#issuecomment-761703555", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1181", "id": 761703555, "node_id": "MDEyOklzc3VlQ29tbWVudDc2MTcwMzU1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-17T00:24:20Z", "updated_at": "2021-01-17T00:24:40Z", "author_association": "OWNER", "body": "Here's the incomplete sketch of a test - to go at the bottom of `test_cli.py`.\r\n\r\n```python\r\n@pytest.mark.parametrize(\r\n \"filename\", [\"test-database (1).sqlite\", \"database (1).sqlite\"]\r\n)\r\ndef test_weird_database_names(ensure_eventloop, tmpdir, filename):\r\n # https://github.com/simonw/datasette/issues/1181\r\n runner = CliRunner()\r\n db_path = str(tmpdir / filename)\r\n sqlite3.connect(db_path).execute(\"vacuum\")\r\n result1 = runner.invoke(cli, [db_path, \"--get\", \"/\"])\r\n assert result1.exit_code == 0, result1.output\r\n homepage_html = result1.output\r\n assert False\r\n```\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 781262510, "label": "Certain database names results in 404: \"Database not found: None\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1181#issuecomment-756487966", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1181", "id": 756487966, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NjQ4Nzk2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-08T01:25:42Z", "updated_at": "2021-01-08T01:25:42Z", "author_association": "OWNER", "body": "I'm going to add a unit test that tries a variety of weird database names.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 781262510, "label": "Certain database names results in 404: \"Database not found: None\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1181#issuecomment-756482163", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1181", "id": 756482163, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NjQ4MjE2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-08T01:06:23Z", "updated_at": "2021-01-08T01:06:54Z", "author_association": "OWNER", "body": "Yes, that logic is definitely at fault. It looks like it applies `urllib.parse.unquote_plus()` AFTER it's tried to do the `-` hash splitting thing, which is why it's failing here:\r\n\r\nhttps://github.com/simonw/datasette/blob/97fb10c17dd007a275ab743742e93e932335ad67/datasette/views/base.py#L184-L198", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 781262510, "label": "Certain database names results in 404: \"Database not found: None\""}, "performed_via_github_app": null}