[issue31125] shelve.open of temporary file fails with error "anydbm.error: db type could not be determined"

2017-08-06 Thread R. David Murray

R. David Murray added the comment:

By the way, if you want to open a doc issue with a suggestion of how to clarify 
this in the docs, that would be welcome.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31125] shelve.open of temporary file fails with error "anydbm.error: db type could not be determined"

2017-08-06 Thread R. David Murray

R. David Murray added the comment:

No, it should not.  A DBM is not necessarily a single file.  What you should be 
doing is creating a temporary *directory*, and opening your DB inside that.

--
components: +Library (Lib) -IO
nosy: +r.david.murray
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31125] shelve.open of temporary file fails with error "anydbm.error: db type could not be determined"

2017-08-05 Thread Stephen Larroque

New submission from Stephen Larroque:

This is a followup of issue 23174.

When using `shelve.open(tempfile.mkstemp()[1])`, the shelve (or anydbm or 
dumbdbm) fail with "anydbm.error: db type could not be determined".

Instead, the module could detect the file is empty and use it as if it were not 
existing before ('c' or 'n' flag). For the moment, there is no way around 
except creating the temporary file and then delete it.

--
components: IO
messages: 299790
nosy: Stephen Larroque
priority: normal
severity: normal
status: open
title: shelve.open of temporary file fails with error "anydbm.error: db type 
could not be determined"
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com