Skip to content

float.fromhex discrepancy under Solaris #47883

Closed

Description

@pitrou
BPO 3633
Nosy @mdickinson, @pitrou, @benjaminp
Files
  • issue3633_test.patch: Patch to make tests produce more info on failure
  • issue3633.patch: Possible fix
  • 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 = 'https://github.com/mdickinson'
    closed_at = <Date 2008-08-22.01:59:38.969>
    created_at = <Date 2008-08-21.13:18:34.632>
    labels = ['interpreter-core', 'type-bug']
    title = 'float.fromhex discrepancy under Solaris'
    updated_at = <Date 2009-04-18.17:56:16.272>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2009-04-18.17:56:16.272>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2008-08-22.01:59:38.969>
    closer = 'benjamin.peterson'
    components = ['Interpreter Core']
    creation = <Date 2008-08-21.13:18:34.632>
    creator = 'pitrou'
    dependencies = []
    files = ['11197', '11199']
    hgrepos = []
    issue_num = 3633
    keywords = ['patch', 'needs review']
    message_count = 14.0
    messages = ['71635', '71640', '71644', '71672', '71673', '71675', '71681', '71683', '71685', '71686', '71688', '71689', '71717', '86128']
    nosy_count = 3.0
    nosy_names = ['mark.dickinson', 'pitrou', 'benjamin.peterson']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3633'
    versions = ['Python 2.6', 'Python 3.0']

    Activity

    1. pitrou commented on Aug 21, 2008

      @pitrou
      MemberAuthor

      This is a failure that seems to occur quite often (always?) on the
      Solaris buildbot:

      ======================================================================
      FAIL: test_invalid_inputs (test.test_float.HexFloatTestCase)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File
      "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_float.py",
      line 451, in test_invalid_inputs
          self.assertRaises(ValueError, fromHex, x)
      AssertionError: ValueError not raised by fromhex

    2. added
      interpreter-core
      type-bug
      on Aug 21, 2008
    3. benjaminp commented on Aug 21, 2008

      @benjaminp
      Contributor

      This probably has been happening for quite a while. We just didn't
      notice because that bot was busy hanging on test_nis.

      The failure is in test_math. Mark, do you know anything?

    4. mdickinson commented on Aug 21, 2008

      @mdickinson
      Member

      I'll take a look, though if anyone has some time to spare and access to a
      Solaris machine then they can probably figure this out more quickly.

      The first step would be to fix the test so that it at least shows which
      input the failure occurs for.

    5. self-assigned this
      on Aug 21, 2008
    6. mdickinson commented on Aug 21, 2008

      @mdickinson
      Member

      Here's a patch for the test-suite to get more information about where
      float.fromhex is failing. Could someone else please review this quickly
      so that I can check it in? It shouldn't take more than a few minutes to
      review.

    7. benjaminp commented on Aug 21, 2008

      @benjaminp
      Contributor

      That looks fine.

    8. mdickinson commented on Aug 21, 2008

      @mdickinson
      Member

      Thanks, Benjamin! Change to test committed in r65958, merged to py3k in
      r65959. Time to watch the py3k solaris buildbot.

    9. mdickinson commented on Aug 21, 2008

      @mdickinson
      Member

      The problem appears to be that on Solaris, the isxdigit function (which
      is supposed to check whether a character is a valid hex digit) returns
      true for Unicode fullwidth digits. On other systems I have access to,
      isxdigit just returns true for the ASCII hex digits, and you use the C99
      iswxdigit function if you want to allow other Unicode digits.

      One could argue that these fullwidth digits should be permitted, but I
      don't know any quick way to convert a unicode digit to its value. For
      now, it just seems simplest to replace the isxdigit call with an
      explicit check for the ASCII 7-bit characters '0' through '9', 'a'
      through 'f'.

    10. pitrou commented on Aug 21, 2008

      @pitrou
      MemberAuthor

      Le jeudi 21 août 2008 à 21:12 +0000, Mark Dickinson a écrit :

      For now, it just seems simplest to replace the isxdigit call with an
      explicit check for the ASCII 7-bit characters '0' through '9', 'a'
      through 'f'.

      +1
      I don't think it makes a lot of sense to support full width unicode
      digits. Hex representation is quite specialized, it won't be produced by
      casual users.

    11. mdickinson commented on Aug 21, 2008

      @mdickinson
      Member

      Here's a patch. I'm reasonably confident that this should fix the
      problem, but I don't have a Solaris machine to test it on.

      If anyone can check this on Solaris that would be fantastic, but I'll
      settle for a 'looks okay to me' from another core developer.

    12. mdickinson commented on Aug 21, 2008

      @mdickinson
      Member

      ...and here's the actual patch!

    13. pitrou commented on Aug 21, 2008

      @pitrou
      MemberAuthor

      Le jeudi 21 août 2008 à 21:26 +0000, Mark Dickinson a écrit :

      Here's a patch. I'm reasonably confident that this should fix the
      problem, but I don't have a Solaris machine to test it on.

      If anyone can check this on Solaris that would be fantastic, but I'll
      settle for a 'looks okay to me' from another core developer.

      Looks okay to me.

    14. mdickinson commented on Aug 21, 2008

      @mdickinson
      Member

      Thanks, Antoine. Committed, r65964 (2.6) and r65965 (3.0). Setting
      status to pending; will close if/when the Solaris buildbot goes green.

    15. benjaminp commented on Aug 22, 2008

      @benjaminp
      Contributor

      The buildbot is still failing, but not on test_math.

    16. mdickinson commented on Apr 18, 2009

      @mdickinson
      Member

      A postscript: looking back at this from afar, the original error was
      almost certainly due to a missing Py_CHARMASK around the arguments
      to isdigit and isxdigit, and nothing to do with Unicode fullwidth digits
      at all.

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

    Labels

    interpreter-coretype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions