diff --git a/databases/core.py b/databases/core.py
index 9034e5f..b8da05e 100644
--- a/databases/core.py
+++ b/databases/core.py
@@ -362,7 +362,10 @@ class DatabaseURL:
 
     @property
     def database(self) -> str:
-        return self.components.path.lstrip("/")
+        path = self.components.path
+        if path.startswith("/"):
+            path = path[1:]
+        return path
 
     @property
     def options(self) -> dict:

How to specify SQLite database fullpath as database URL
When I specify an absolute path of SQLite database file as database url as below, aiosqlite cannot open the database file. (on MacOS)
When I use a relative path like `sqlite:///example.db`, it works fine.
How could I specify the absolute path?

```
database = databases.Database('sqlite:////Users/otsuka/path/to/example.db')
await database.connect()

await database.fetch_all('select * from users')

.venv/lib/python3.7/site-packages/aiosqlite/core.py in connector()
    300             loc = str(database)
    301 
--> 302         return sqlite3.connect(loc, **kwargs)
    303 
    304     return Connection(connector, loop)

OperationalError: unable to open database file
```

diff --git a/tests/test_database_url.py b/tests/test_database_url.py
index 6324f3a..f3a63db 100644
--- a/tests/test_database_url.py
+++ b/tests/test_database_url.py
@@ -51,3 +51,9 @@ def test_replace_database_url_components():
     new = u.replace(database="test_" + u.database)
     assert new.database == "test_mydatabase"
     assert str(new) == "sqlite:///test_mydatabase"
+
+    u = DatabaseURL("sqlite:////absolute/path")
+    assert u.database == "/absolute/path"
+    new = u.replace(database=u.database + "_test")
+    assert new.database == "/absolute/path_test"
+    assert str(new) == "sqlite:////absolute/path_test"
diff --git a/tests/test_importer.py b/tests/test_importer.py
index ed3f894..832e197 100644
--- a/tests/test_importer.py
+++ b/tests/test_importer.py
@@ -4,28 +4,28 @@ from databases.importer import ImportFromStringError, import_from_string
 
 
 def test_invalid_format():
-    with pytest.raises(ImportFromStringError) as exc:
+    with pytest.raises(ImportFromStringError) as exc_info:
         import_from_string("example:")
     expected = 'Import string "example:" must be in format "<module>:<attribute>".'
-    assert expected in str(exc)
+    assert expected in str(exc_info.value)
 
 
 def test_invalid_module():
-    with pytest.raises(ImportFromStringError) as exc:
+    with pytest.raises(ImportFromStringError) as exc_info:
         import_from_string("module_does_not_exist:myattr")
     expected = 'Could not import module "module_does_not_exist".'
-    assert expected in str(exc)
+    assert expected in str(exc_info.value)
 
 
 def test_invalid_attr():
-    with pytest.raises(ImportFromStringError) as exc:
+    with pytest.raises(ImportFromStringError) as exc_info:
         import_from_string("tempfile:attr_does_not_exist")
     expected = 'Attribute "attr_does_not_exist" not found in module "tempfile".'
-    assert expected in str(exc)
+    assert expected in str(exc_info.value)
 
 
 def test_internal_import_error():
-    with pytest.raises(ImportError) as exc:
+    with pytest.raises(ImportError):
         import_from_string("tests.importer.raise_import_error:myattr")
 
 

pip install -e .
parse_log_pytest
requirements.txt
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aiomysql==0.2.0
aiosqlite==0.21.0
anyio==4.9.0
async-timeout==5.0.1
asyncpg==0.30.0
autoflake==2.3.1
black==25.1.0
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
codecov==2.1.13
coverage==7.8.0
-e git+https://github.com/encode/databases.git@9cb2202c25e8c0c149c535ea21d5b56c4395a584#egg=databases
exceptiongroup==1.2.2
greenlet==3.1.1
idna==3.10
iniconfig==2.1.0
isort==6.0.1
mypy==1.15.0
mypy-extensions==1.0.0
packaging==24.2
pathspec==0.12.1
platformdirs==4.3.7
pluggy==1.5.0
psycopg2-binary==2.9.10
pyflakes==3.3.1
PyMySQL==1.1.1
pytest==8.3.5
pytest-cov==6.0.0
requests==2.32.3
sniffio==1.3.1
SQLAlchemy==2.0.40
starlette==0.46.1
tomli==2.2.1
typing_extensions==4.13.0
urllib3==2.3.0

name: databases
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aiomysql==0.2.0
      - aiosqlite==0.21.0
      - anyio==4.9.0
      - async-timeout==5.0.1
      - asyncpg==0.30.0
      - autoflake==2.3.1
      - black==25.1.0
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - click==8.1.8
      - codecov==2.1.13
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - greenlet==3.1.1
      - idna==3.10
      - iniconfig==2.1.0
      - isort==6.0.1
      - mypy==1.15.0
      - mypy-extensions==1.0.0
      - packaging==24.2
      - pathspec==0.12.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - psycopg2-binary==2.9.10
      - pyflakes==3.3.1
      - pymysql==1.1.1
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - requests==2.32.3
      - sniffio==1.3.1
      - sqlalchemy==2.0.40
      - starlette==0.46.1
      - tomli==2.2.1
      - typing-extensions==4.13.0
      - urllib3==2.3.0
prefix: /opt/conda/envs/databases

tests/test_database_url.py::test_replace_database_url_components
tests/test_database_url.py::test_database_url_repr tests/test_database_url.py::test_database_url_properties tests/test_database_url.py::test_database_url_options tests/test_importer.py::test_invalid_format tests/test_importer.py::test_invalid_module tests/test_importer.py::test_invalid_attr tests/test_importer.py::test_internal_import_error tests/test_importer.py::test_valid_import
databases/core.py
databases/core.py