Repository navigation
Fix run-server debug mode crash on base_url - #142
Merged
Merged
Conversation
Bottle's app object refuses to set an attribute that is already defined, so start_bottle_server() crashed with "Attribute base_url already defined. Plugin conflict?" whenever the port wasn't 80 or 443, which includes the default http://localhost:8080. The URL is now built in a local variable and assigned to dibs.base_url once. Tested with run-server --mode debug under Python 3.12: the server starts, / and /about return 200, and /list redirects to http://localhost:8080/notallowed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
admin/run-server --mode debugcrashes at startup:start_bottle_server()setdibs.base_urland then, when the port isn’t 80 or 443, set it again with the port added. Bottle’s app object won’t let an attribute be set a second time. The default base URL ishttp://localhost:8080, so debug mode always crashed.Change
Build the URL in a local variable and assign
dibs.base_urlonce.Testing
Python 3.12,
run-server --mode debugwith the default base URL, using a stand-inmod_wsgimodule because mod-wsgi can’t be built on macOS without Apache headers. Debug mode doesn’t use mod-wsgi./and/aboutreturn 200, and their links usehttp://localhost:8080./listredirects tohttp://localhost:8080/notallowed, so redirects get the port too.This branch is based on
mainand is independent of #141; the two change different parts ofadmin/run-server.🤖 Generated with Claude Code