[issue40563] Support pathlike objects on dbm/shelve

2021-09-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution, Hakan, Henry-Joseph.

Sorry, David, there was already a PR, and it was not dead, it just waited for a 
coredev review.

--
resolution:  -> fixed
stage: patch review -> 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



[issue40563] Support pathlike objects on dbm/shelve

2021-09-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 707137b8637feef37b2e06a851fdca9d1b945861 by Henry-Joseph Audéoud 
in branch 'main':
bpo-40563: Support pathlike objects on dbm/shelve (GH-21849)
https://github.com/python/cpython/commit/707137b8637feef37b2e06a851fdca9d1b945861


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2021-09-08 Thread David Mertz


David Mertz  added the comment:

If anyone wants to look at my not-yet-complete changes (see other comment), 
it's https://github.com/DavidMertz/cpython/tree/bpo-45133.  It has a different 
bpo because I filed a duplicate before realizing.  I can change the branch name 
before a PR, but making it work is the more important issue.

--

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2021-09-08 Thread David Mertz


David Mertz  added the comment:

I've made the few additional changes to those in this PR.  When I work out the 
issues, I'll make a new PR.  I took out an attempt with `path_t`.  However, 
here is why I think argument clinic (or something else?!) is actually 
intercepting the attempted call:

With my temporary debugging, I have this function in `Modules/_gdbmmodule.c`:

```c
[clinic start generated code]*/

static PyObject *
dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
 int mode)
/*[clinic end generated code: output=9527750f5df90764 input=812b7d74399ceb0e]*/
{
PyObject_Print(filename, stdout, 0);
printf(" from _gdbmmodule.c (XXX)\n");
/* ... rest of function ...*/
```

And I have a very simplified test script:

```python
import _gdbm
import sys
from pathlib import Path

print(sys.version)
path = '/tmp/tmp.db'

db = _gdbm.open(path, 'c')
print("Opened with string path")
db.close()

db = _gdbm.open(Path(path), 'c')
print("Opened with path-like")
db.close()
```

The output of running this is:

```
3.11.0a0 
(heads/[bpo-45133](https://bugs.python.org/issue45133)-dirty:0376feb030, Sep  8 
2021, 00:39:39) [GCC 10.3.0]
'/tmp/tmp.db' from _gdbmmodule.c (XXX)
Opened with string path
Traceback (most recent call last):
  File "/home/dmertz/tmp/pathlike-dbm.py", line 12, in 
db = _gdbm.open(Path(path), 'c')
 ^^^
TypeError: open() argument 1 must be str, not PosixPath
```

So before I get to the first line of the _gdbm.open() function, the TypeError 
is already occurring when passed a PosixPath.

--
nosy: +DavidMertz
type:  -> enhancement
versions: +Python 3.11 -Python 3.9

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2021-09-07 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2021-09-07 Thread Gene Wood


Gene Wood  added the comment:

@DahlitzFlorian it looks like a PR was submitted August of last year : 
https://github.com/python/cpython/pull/21849

--
nosy: +gene_wood

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2020-08-12 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +20977
pull_request: https://github.com/python/cpython/pull/21849

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2020-06-02 Thread Sam Bull


Change by Sam Bull :


--
nosy: +dreamsorcerer

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2020-05-20 Thread Hakan Çelik

Change by Hakan Çelik :


--
keywords: +patch
pull_requests: +19554
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20274

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2020-05-20 Thread Hakan Çelik

Hakan Çelik  added the comment:

Yes I will send pr soon.

--

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2020-05-20 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

Are you still working on this @hakancelik?

--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2020-05-08 Thread Hakan


Hakan  added the comment:

I work on this issue to fix it.

--
nosy: +hakancelik

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2020-05-08 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

>>> dbm.open("/tmp/x.db", "n").close()
>>> from pathlib import Path
>>> tmp = Path("/tmp")
>>> dbm.open(tmp / "x.db", "n").close()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.9/dbm/__init__.py", line 95, in open
return mod.open(file, flag, mode)
TypeError: open() argument 1 must be str, not PosixPath

--
components: Library (Lib)
keywords: easy
messages: 368446
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: Support pathlike objects on dbm/shelve
versions: Python 3.9

___
Python tracker 

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