Skip to content

Commit 4699f3e

Browse files
committed
use ZConfig.loadConfigFile to workaround urlib.request.urlopen regression on Windows
1 parent 3a0f0db commit 4699f3e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGES.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111

1212
This will be the last RelStorage release to support Python 3.9.
1313

14+
.. warning::
15+
16+
Current releases of ``persistent``, up through at least 6.1.1,
17+
do not properly invalidate objects on Python 3.14. Most
18+
applications probably won't notice, but there may be issues with
19+
blobs, or if applications have a particular reliance on
20+
``__dict__`` being immediately cleared after an object is
21+
invalidated. See `PR 221 <https://github.com/zopefoundation/persistent/pull/221>`_.
22+
1423
- Include ``psycopg2`` in the ``postgresql`` extra on CPython 3.13+.
1524
See :issue:`515`.
1625
- Increase the minimum supported version of ``mysql-connector-python``

src/relstorage/tests/test_zodbconvert.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,13 @@ def _load_zconfig(self):
415415
schema = ZConfig.loadSchemaFile(StringIO(schema_xml))
416416

417417
self.assertTrue(os.path.exists(self.cfgfile), self.cfgfile)
418-
conf, _ = ZConfig.loadConfig(schema, self.cfgfile)
418+
with open(self.cfgfile, 'rt', encoding='utf-8') as f:
419+
# loadConfig() takes a *URL*, not a path; under the covers, it
420+
# calls ``urllib.request.urlopen``. Prior to 3.14, passing
421+
# a path to this function worked fine everywhere. In 3.14,
422+
# they broke this on Windows, and it now complains
423+
# "Can't open network file \\\\c:\...". So do it for them.
424+
conf, _ = ZConfig.loadConfigFile(schema, f)
419425

420426
return conf
421427

0 commit comments

Comments
 (0)