Skip to content

test_mailbox fails if the hostname is empty #75808

Closed

Description

@serhiy-storchaka
BPO 31627
Nosy @warsaw, @bitdancer, @skrah, @serhiy-storchaka, @koobs
PRs
  • bpo-31627: Make test_mailbox be lenient to empty hostname. #3821
  • [3.6] bpo-31627: Make test_mailbox be lenient to empty hostname. (GH-3821) #3837
  • [2.7] bpo-31627: Make test_mailbox be lenient to empty hostname. (GH-3821) #3838
  • 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-09-30.19:54:03.956>
    created_at = <Date 2017-09-29.07:17:31.265>
    labels = ['3.7', 'type-bug', 'tests', 'expert-email']
    title = 'test_mailbox fails if the hostname is empty'
    updated_at = <Date 2017-09-30.19:54:03.956>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-09-30.19:54:03.956>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-09-30.19:54:03.956>
    closer = 'serhiy.storchaka'
    components = ['Tests', 'email', 'FreeBSD']
    creation = <Date 2017-09-29.07:17:31.265>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31627
    keywords = ['patch']
    message_count = 5.0
    messages = ['303304', '303329', '303411', '303421', '303422']
    nosy_count = 5.0
    nosy_names = ['barry', 'r.david.murray', 'skrah', 'serhiy.storchaka', 'koobs']
    pr_nums = ['3821', '3837', '3838']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31627'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    Activity

    1. serhiy-storchaka commented on Sep 29, 2017

      @serhiy-storchaka
      MemberAuthor

      On just installed FreeBSD the hostname is empty. This causes a failure of test_mailbox.

      ======================================================================
      FAIL: test_create_tmp (test.test_mailbox.TestMaildir)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/usr/home/serhiy/py/cpython3.7-debug/Lib/test/test_mailbox.py", line 758, in test_create_tmp
          self.assertIsNotNone(match, "Invalid file name: '%s'" % tail)
      AssertionError: unexpectedly None : Invalid file name: '1506668827.M125806P21276Q34.'

      Changing the "+" qualifier to the "*" qualifier in the regex pattern fixes the issue.

               pattern = re.compile(r"(?P<time>\d+)\.M(?P<M>\d{1,6})P(?P<P>\d+)"
      -                             r"Q(?P<Q>\d+)\.(?P<host>[^:/]+)")
      +                             r"Q(?P<Q>\d+)\.(?P<host>[^:/]*)")
    2. added
      tests
      type-bug
      on Sep 29, 2017
    3. changed the title [-]test_mailbox if the hostname is empty[/-] [+]test_mailbox fails if the hostname is empty[/+] on Sep 29, 2017
    4. bitdancer commented on Sep 29, 2017

      @bitdancer
      Member

      A system with no hostname can be considered to be improperly configured, but it doesn't look like this would weaken the test, so I think it is OK.

    5. serhiy-storchaka commented on Sep 30, 2017

      @serhiy-storchaka
      MemberAuthor

      New changeset f4ea642 by Serhiy Storchaka in branch 'master':
      bpo-31627: Make test_mailbox be lenient to empty hostname. (bpo-3821)
      f4ea642

    6. serhiy-storchaka commented on Sep 30, 2017

      @serhiy-storchaka
      MemberAuthor

      New changeset d9c21a4 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
      [3.6] bpo-31627: Make test_mailbox be lenient to empty hostname. (GH-3821) (bpo-3837)
      d9c21a4

    7. serhiy-storchaka commented on Sep 30, 2017

      @serhiy-storchaka
      MemberAuthor

      New changeset 1163fb9 by Serhiy Storchaka in branch '2.7':
      [2.7] bpo-31627: Make test_mailbox be lenient to empty hostname. (GH-3821) (bpo-3838)
      1163fb9

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)teststopic-emailtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions