New submission from Dima Tisnek:
shelve.open("foo.db") creates "foo.db" on Linux and "foo.db.db" on OSX.
Something to that extent is even documented:
"""d = shelve.open(filename) # open, with (g)dbm filename -- no suffix"""
and
"""As a side-effect, an extension may be added to the filename and more than
one file may be created."""
Still, it's super-quirky, it's almost as if the message was "don't use shelve."
Some ways out:
* ValueError if "." in basename(filaneme) # a hammer
* ValueError if filename.endswith((".db", ".gdbm", ...)) # block only known
extensions
* strip extension if it's known that underlying library is going to add it
* patch underlying library to always use filename verbatim
----------
components: Extension Modules
messages: 260362
nosy: Dima.Tisnek
priority: normal
severity: normal
status: open
title: shelve filename inconsistent between platforms
type: behavior
versions: Python 3.5
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26370>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com