This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: test_crypt fails on OpenBSD
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ced, davin, jafo, python-dev, rpointel, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2015-10-01 06:49 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
crypt_openbsd.patch vstinner, 2015-10-01 06:49 review
Pull Requests
URL Status Linked Edit
PR 4111 merged serhiy.storchaka, 2017-10-24 19:10
PR 4112 merged serhiy.storchaka, 2017-10-24 20:20
Messages (8)
msg251998 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-10-01 06:49
It looks like crypt.crypt('', crypt.METHOD_CRYPT) returns None. This method must be excluded from crypt.methods. Attached patch should fix the issue, but I didn't try it on OpenBSD.

Python 3.4-3.6 is affect, Python 2.7 is not affect (crypt.methods was introduced in Python 3).

test_saltedcrypt (test.test_crypt.CryptTestCase) ... ERROR

ERROR: test_saltedcrypt (test.test_crypt.CryptTestCase)
Traceback (most recent call last):
  File "/home/python-builds/3.5.borja-openbsd-x86/build/Lib/test/", line 23, in test_saltedcrypt
    self.assertEqual(len(pw), method.total_size)
TypeError: object of type 'NoneType' has no len()

msg252158 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-10-02 21:02
New changeset 4da7edbf78d4 by Victor Stinner in branch 'default':
Issue #25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not
msg252592 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-10-09 07:23
Hum, the test now fails differently :-(

FAIL: test_methods (test.test_crypt.CryptTestCase)
Traceback (most recent call last):
  File "/home/python-builds/3.x.borja-openbsd-x86/build/Lib/test/", line 29, in test_methods
    self.assertTrue(len(crypt.methods) >= 1)
AssertionError: False is not true
msg299193 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-26 02:59
There is no more OpenBSD buildbot. I have no OpenBSD VM. I just close this old issue.
msg303316 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-29 09:10
I have an OpenBSD VM.
msg304929 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-24 16:47
issue31664 fixes test_crypt in 3.7. In other versions the test should be just skipped on OpenBSD. Blowfish is the only method supported on OpenBSD, but it was not supported by the Python's crypt module.
msg304938 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-24 20:11
New changeset f52dff611cff2fb9e90340b4787eda50ab2d40c6 by Serhiy Storchaka in branch '3.6':
bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (#4111)
msg304940 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-24 20:35
New changeset 04c0a4038e8764f742de8505600b8ee97ee50776 by Serhiy Storchaka in branch '2.7':
[2.7] bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (GH-4111). (#4112)
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69474
2017-10-24 20:36:06serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-10-24 20:35:24serhiy.storchakasetmessages: + msg304940
2017-10-24 20:20:48serhiy.storchakasetpull_requests: + pull_request4082
2017-10-24 20:11:48serhiy.storchakasetmessages: + msg304938
2017-10-24 19:10:52serhiy.storchakasetstage: patch review
pull_requests: + pull_request4081
2017-10-24 16:47:42serhiy.storchakasetmessages: + msg304929
2017-09-29 09:44:52serhiy.storchakasetnosy: + davin
2017-09-29 09:10:11serhiy.storchakasetstatus: closed -> open

type: behavior
components: + Library (Lib)
versions: + Python 3.7, - Python 3.4, Python 3.5
nosy: + serhiy.storchaka, jafo

messages: + msg303316
resolution: out of date -> (no value)
stage: resolved -> (no value)
2017-09-29 09:07:11serhiy.storchakalinkissue31633 superseder
2017-07-26 02:59:14vstinnersetstatus: open -> closed
resolution: out of date
messages: + msg299193

stage: resolved
2016-01-16 20:09:32cedsetnosy: + ced
2015-10-09 07:23:27vstinnersetmessages: + msg252592
2015-10-02 21:02:42python-devsetnosy: + python-dev
messages: + msg252158
2015-10-01 06:50:11vstinnersetnosy: + rpointel
2015-10-01 06:49:50vstinnercreate