classification
Title: dbm.open() encodes filename with default encoding rather than the filesystem encoding
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Josh Friend, arigo, miss-islington, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-02-23 15:11 by Josh Friend, last changed 2018-02-27 01:39 by serhiy.storchaka.

Pull Requests
URL Status Linked Edit
PR 5832 merged serhiy.storchaka, 2018-02-23 17:14
PR 5905 merged miss-islington, 2018-02-26 14:02
PR 5906 merged serhiy.storchaka, 2018-02-26 14:30
Messages (6)
msg312636 - (view) Author: Josh Friend (Josh Friend) Date: 2018-02-23 15:11
Armin Rigo from the PyPy project pointed this out to me: https://bitbucket.org/pypy/pypy/issues/2755/dbmopen-expects-a-str-for-filename-throws

This could probably lead to some weird behavior given the right filename
msg312649 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-02-23 17:18
PR 5832 fixes dbm.ndbm.open() and dbm.gdbm.open(). dbm.dumb.open() already used the filesystem encoding.

I don't think anything should be fixed in 2.7. Supporting Unicode filenames looks like a new feature.
msg312664 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2018-02-23 18:43
It's not a new feature.  See for example all functions from posixmodule.c: it should at least be PyArg_ParseTuple(args, "et", Py_FileSystemDefaultEncoding, &char_star_variable).
msg312925 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-02-26 14:02
New changeset 6f600ff1734ca2fdcdd37a809adf8130f0d8cc4e by Serhiy Storchaka in branch 'master':
bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832)
https://github.com/python/cpython/commit/6f600ff1734ca2fdcdd37a809adf8130f0d8cc4e
msg312927 - (view) Author: miss-islington (miss-islington) Date: 2018-02-26 14:25
New changeset a9e0b070b3e36701d0139361c769d374c4aacf1a by Miss Islington (bot) in branch '3.7':
bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832)
https://github.com/python/cpython/commit/a9e0b070b3e36701d0139361c769d374c4aacf1a
msg312977 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-02-27 01:39
New changeset 5bf74859fe253f0e8ff73ba699cd1a7e2dfbcea3 by Serhiy Storchaka in branch '3.6':
[3.6] bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832). (GH-5906)
https://github.com/python/cpython/commit/5bf74859fe253f0e8ff73ba699cd1a7e2dfbcea3
History
Date User Action Args
2018-02-27 01:39:55serhiy.storchakasetmessages: + msg312977
2018-02-26 14:30:48serhiy.storchakasetpull_requests: + pull_request5677
2018-02-26 14:25:42miss-islingtonsetnosy: + miss-islington
messages: + msg312927
2018-02-26 14:02:47miss-islingtonsetpull_requests: + pull_request5676
2018-02-26 14:02:30serhiy.storchakasetmessages: + msg312925
2018-02-23 18:43:22arigosetnosy: + arigo
messages: + msg312664
2018-02-23 17:18:05serhiy.storchakasetmessages: + msg312649
versions: + Python 3.7, Python 3.8, - Python 2.7
2018-02-23 17:14:01serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request5610
2018-02-23 17:09:49serhiy.storchakasetassignee: serhiy.storchaka
2018-02-23 15:20:47serhiy.storchakasetnosy: + serhiy.storchaka
2018-02-23 15:11:08Josh Friendcreate