[issue32033] The pwd module implementation incorrectly sets some attributes to None

2022-03-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 4aea656d62860e78cd8384f2de375f0d4f1db579 by Christian Heimes in 
branch 'main':
bpo-32033: Finalize WASI configure options (GH-32053)
https://github.com/python/cpython/commit/4aea656d62860e78cd8384f2de375f0d4f1db579


--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2022-03-22 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes
nosy_count: 5.0 -> 6.0
pull_requests: +30143
pull_request: https://github.com/python/cpython/pull/32053

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-14 Thread miss-islington


miss-islington  added the comment:


New changeset 8821200d85657ef3bbec78dcb43694449c05e896 by Miss Islington (bot) 
in branch '3.7':
bpo-32033: Fix test_pwd failures on Android (GH-19502)
https://github.com/python/cpython/commit/8821200d85657ef3bbec78dcb43694449c05e896


--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-14 Thread miss-islington


miss-islington  added the comment:


New changeset 1e1dbdf23f7a18f53a3257badc3541973831f2c4 by Miss Islington (bot) 
in branch '3.8':
bpo-32033: Fix test_pwd failures on Android (GH-19502)
https://github.com/python/cpython/commit/1e1dbdf23f7a18f53a3257badc3541973831f2c4


--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

It's now fixed in master and backports to 3.7 and 3.8 will be merged as soon as 
the CI pass.

--
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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18869
pull_request: https://github.com/python/cpython/pull/19519

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +18868
pull_request: https://github.com/python/cpython/pull/19518

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 96515e9f6785328c52ebc5d4ce60e0087a9adc2d by Zackery Spytz in 
branch 'master':
bpo-32033: Fix test_pwd failures on Android (GH-19502)
https://github.com/python/cpython/commit/96515e9f6785328c52ebc5d4ce60e0087a9adc2d


--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-13 Thread Zackery Spytz


Change by Zackery Spytz :


--
versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.6

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2020-04-13 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 3.0 -> 4.0
pull_requests: +18853
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19502

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

> And at least for pw_shell the behavior for NULL and "" are different.

What is the difference between the two?

--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2017-11-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

On your second link it is documented explicitly that pw_dir and pw_shell might 
be NULL. And at least for pw_shell the behavior for NULL and "" are different.

--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2017-11-22 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Changing test_pwd does not correct the fact that the current implementation of 
the pwd module may break an existing Python application since this (old indeed) 
API states "The uid and gid items are integers, all others are strings".

> returning an empty string instead of None will make impossible to distinguish 
> NULL from "".

AFAIK in the 50 years since the creation of the unix operating system, there 
has never been an implementation of pwd that states that a string field may be 
either an empty string or NULL. And it is doubtful that there will ever be one, 
since this would break all (all, not just the Python applications) existing 
applications using pwd.

--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2017-11-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I disagree. This is an old API, a thin wrapper around standard POSIX API, and 
returning an empty string instead of None will make impossible to distinguish 
NULL from "".

It is easy to convert None in an empty string in Python: `value or ''`.

I would change the test to

if field is not None:
self.assertIsInstance(field, str)

or

self.assertIsInstance(field, (str, type(None)))

(I prefer the former variant).

--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2017-11-15 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

> I'm not sure that it's very useful to distinguish NULL and an empty char* 
> string.

I agree. An attribute of a ('pwd' Python module) password database entry 
corresponds to the field of a line in a 'passwd' text file. So it makes sense 
that when the field is empty in the text file, the corresponding attribute be 
an empty string and never None if it is not an integer (FWIW Android does not 
have a 'passwd' file).

Changing the title of the issue.

--
components:  -Tests
title: The pwd test test_values fails on Android -> The pwd module 
implementation incorrectly sets some attributes to None
versions: +Python 2.7, Python 3.6

___
Python tracker 

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