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_crypt fails on OpenBSD #69474

Closed
vstinner opened this issue Oct 1, 2015 · 8 comments
Closed

test_crypt fails on OpenBSD #69474

vstinner opened this issue Oct 1, 2015 · 8 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

vstinner commented Oct 1, 2015

BPO 25287
Nosy @vstinner, @cedk, @serhiy-storchaka, @applio
PRs
  • bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. #4111
  • [2.7] bpo-25287: Improve test_crypt and skip it on OpenBSD. (GH-4111). #4112
  • Files
  • crypt_openbsd.patch
  • 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 2017-10-24.20:36:06.526>
    created_at = <Date 2015-10-01.06:49:50.962>
    labels = ['3.7', 'type-bug', 'library']
    title = 'test_crypt fails on OpenBSD'
    updated_at = <Date 2017-10-24.20:36:06.525>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2017-10-24.20:36:06.525>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-10-24.20:36:06.526>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2015-10-01.06:49:50.962>
    creator = 'vstinner'
    dependencies = []
    files = ['40639']
    hgrepos = []
    issue_num = 25287
    keywords = ['patch']
    message_count = 8.0
    messages = ['251998', '252158', '252592', '299193', '303316', '304929', '304938', '304940']
    nosy_count = 7.0
    nosy_names = ['jafo', 'vstinner', 'ced', 'python-dev', 'rpointel', 'serhiy.storchaka', 'davin']
    pr_nums = ['4111', '4112']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue25287'
    versions = ['Python 3.6', 'Python 3.7']

    @vstinner
    Copy link
    Member Author

    vstinner commented Oct 1, 2015

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

    http://buildbot.python.org/all/builders/x86%20OpenBSD%203.5/builds/186/steps/test/logs/stdio

    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/test_crypt.py", line 23, in test_saltedcrypt
        self.assertEqual(len(pw), method.total_size)
    TypeError: object of type 'NoneType' has no len()

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 2, 2015

    New changeset 4da7edbf78d4 by Victor Stinner in branch 'default':
    Issue bpo-25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not
    https://hg.python.org/cpython/rev/4da7edbf78d4

    @vstinner
    Copy link
    Member Author

    vstinner commented Oct 9, 2015

    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/test_crypt.py", line 29, in test_methods
        self.assertTrue(len(crypt.methods) >= 1)
    AssertionError: False is not true

    @vstinner
    Copy link
    Member Author

    There is no more OpenBSD buildbot. I have no OpenBSD VM. I just close this old issue.

    @serhiy-storchaka
    Copy link
    Member

    I have an OpenBSD VM.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Sep 29, 2017
    @serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Sep 29, 2017
    @serhiy-storchaka
    Copy link
    Member

    bpo-31664 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.

    @serhiy-storchaka
    Copy link
    Member

    New changeset f52dff6 by Serhiy Storchaka in branch '3.6':
    bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (bpo-4111)
    f52dff6

    @serhiy-storchaka
    Copy link
    Member

    New changeset 04c0a40 by Serhiy Storchaka in branch '2.7':
    [2.7] bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (GH-4111). (bpo-4112)
    04c0a40

    @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
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants