Ticket #2048 (closed defect: migrated)
Drive letter separator in Windows dburi not substituted when using package specific dburi
| Reported by: | tg_werner | Owned by: | Chris Arndt |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1.x bugfix |
| Component: | TurboGears | Version: | 1.0.7 |
| Severity: | normal | Keywords: | dburi, sqlite, windows, config, needs patch, needs tests |
| Cc: |
Description (last modified by Chris Arndt) (diff)
When not using the standard "sqlobject.dburi" in e.g. dev.cfg because of using more than one database (dbone.dburi="sqlite://...", dbtwo.dburi="sqlite://...") an incorrect uri locator is returned from turbogears.config.get() because the drive letter separator does not get substituted.
This could be fixed e.g. by changing Line 214 from:
if value and key == 'sqlobject.dburi' and os.name == "nt":
to:
if value and key.endswith('.dburi') and os.name == "nt":
Change History
comment:1 Changed 4 years ago by Chris Arndt
- Keywords dburi, sqlite, windows, config, needs patch, needs tests added; hub.uri sqlite config removed
- Description modified (diff)
- Summary changed from Problem with .dburi from config-file on windows-sysstems to Drive letter separator in Windows dburi not substituted when using package specific dburi
comment:2 Changed 4 years ago by Chris Arndt
The whole database configuration is a mess with respect to multiple, package-specific dburis. See also #1813.
If you can provide a proper patch and also a test, we'll include this asap. Or we'll see to it when we have time.
comment:3 Changed 4 years ago by Chris Arndt
- Owner changed from faide to Chris Arndt
- Status changed from new to assigned
Unfortunately your fix would break things for sqlalchemy, because with SA a SQLite dburi for a local file on Windows looks "sqlite:///C:/foo.db".
It's also no use to test if the config value contains "sqlalchemy" and then do the reverse conversion, because we also allow several database connections for SA but there is currently no way to tell from the name of the config setting if it's SQLObject or SQLAlchemy connection.
So a fix for this will have to wait until #1813 is done.
comment:4 Changed 4 years ago by Chris Arndt
- Milestone changed from 1.1 to 1.1.x bugfix
After some consideration I think the value mangling in config.get() is a bad idea alltogether. Why not just let users specify the SQLObject dburi for SQLite with a | instead of a colon as SQLite requires it?
I corrected the examples in the quickstart deployment config files in this respect (r6678). If nobody objects, I will soon close this ticket as wontfix and handle the database configuration issues under #1813.
comment:5 Changed 2 years ago by chrisz
- Status changed from assigned to closed
- Resolution set to migrated
Ok, this should be handled in #1813 which has been moved to https://sourceforge.net/p/turbogears1/tickets/9/.