Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.test_spwd.TestSpwdNonRoot failure with FileNotFoundError: #73341

Closed
gerritholl mannequin opened this issue Jan 4, 2017 · 5 comments
Closed

test.test_spwd.TestSpwdNonRoot failure with FileNotFoundError: #73341

gerritholl mannequin opened this issue Jan 4, 2017 · 5 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@gerritholl
Copy link
Mannequin

gerritholl mannequin commented Jan 4, 2017

BPO 29155
Nosy @bitdancer, @gerritholl, @serhiy-storchaka, @iritkatriel

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2022-01-31.00:02:31.191>
created_at = <Date 2017-01-04.16:42:46.458>
labels = ['type-bug', 'tests']
title = 'test.test_spwd.TestSpwdNonRoot  failure with FileNotFoundError:'
updated_at = <Date 2022-01-31.00:02:31.190>
user = 'https://github.com/gerritholl'

bugs.python.org fields:

activity = <Date 2022-01-31.00:02:31.190>
actor = 'iritkatriel'
assignee = 'none'
closed = True
closed_date = <Date 2022-01-31.00:02:31.191>
closer = 'iritkatriel'
components = ['Tests']
creation = <Date 2017-01-04.16:42:46.458>
creator = 'Gerrit.Holl'
dependencies = []
files = []
hgrepos = []
issue_num = 29155
keywords = []
message_count = 5.0
messages = ['284651', '284656', '284657', '299712', '412181']
nosy_count = 5.0
nosy_names = ['r.david.murray', 'Gerrit.Holl', 'serhiy.storchaka', 'rgbyrnes', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue29155'
versions = ['Python 3.6']

@gerritholl
Copy link
Mannequin Author

gerritholl mannequin commented Jan 4, 2017

I am building and testing Python 3.6 on the JASMIN Analysis Platform http://www.jasmin.ac.uk/services/jasmin-analysis-platform/, which runs Red Hat Enterprise Linux Server release 6.8 on a machine with 48 × Intel(R) Xeon(R) CPU E7-4860 v2 @ 2.60GHz, 2 TiB RAM, and a PanFSⓇ http://www.panasas.com/products/panfs distributed file system. test.test_spwd.TestSpwdNonRoot is failing with FileNotFoundError. Below is the full verbose output of ./python -m test -v test_spwd:

== CPython 3.6.0 (default, Jan 4 2017, 14:11:04) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
== Linux-2.6.32-642.6.2.el6.x86_64-x86_64-with-redhat-6.8-Santiago little-endian
== hash algorithm: siphash24 64bit
== cwd: /home/users/gholl/src/Python-3.6.0/build/test_python_40357
== encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
Run tests sequentially
0:00:00 [1/1] test_spwd
test_getspnam_exception (test.test_spwd.TestSpwdNonRoot) ... ERROR
test_getspall (test.test_spwd.TestSpwdRoot) ... skipped 'root privileges required'
test_getspnam (test.test_spwd.TestSpwdRoot) ... skipped 'root privileges required'

======================================================================
ERROR: test_getspnam_exception (test.test_spwd.TestSpwdNonRoot)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/users/gholl/src/Python-3.6.0/Lib/test/test_spwd.py", line 67, in test_getspnam_exception
    spwd.getspnam(name)
FileNotFoundError: [Errno 2] No such file or directory

Ran 3 tests in 0.002s

FAILED (errors=1, skipped=2)
test_spwd failed

1 test failed:
test_spwd

Total duration: 66 ms
Tests result: FAILURE

@bitdancer
Copy link
Member

Since you are seeing errors on your platform that we are not seeing, and we do not have access to your platform, you are going to have to track down the cause, I'm afraid.

@serhiy-storchaka
Copy link
Member

It is easy to add FileNotFoundError to the list of expected exceptions. But it seems to me that the only error that gespname() can return on Linux is EACCES. [1] May be this is a bug of your platform.

[1] http://man7.org/linux/man-pages/man3/getspnam.3.html

@rgbyrnes
Copy link
Mannequin

rgbyrnes mannequin commented Aug 3, 2017

We are seeing this too, on RHEL 7.

It happens when /etc/nsswitch.conf has ...

shadow: files ldap

The ldap nss back end seems to set errno = ENOENT when it gets no response from the ldap server. If we remove ldap (leaving only files), then we see errno = EACCES.

Is it correct to insist on EACCES? The man page cited in the last message says only that ...

The functions that return a pointer return NULL if no more entries are available or if an error occurs during processing.  The functions which have int as the return value return 0 for success and -1 for failure, with errno set to indicate the cause of the error.

getspnam isn't one of the "functions which have int as the return value," so it isn't clear whether application code should make any assumptions about errno when it returns.

@rgbyrnes rgbyrnes mannequin added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Aug 3, 2017
@iritkatriel
Copy link
Member

3.6 is no longer maintained. Please create a new issue if you are seeing this problem on a current version (>= 3.9).

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants