1. 13 Apr, 2006 5 commits
  2. 12 Apr, 2006 31 commits
  3. 11 Apr, 2006 4 commits
    • Thomas Wouters's avatar
      Fix int() and long() to repr() their argument when formatting the exception, · 2dfeda7a
      Thomas Wouters authored
      to avoid confusing situations like:
      
      >>> int("")
      ValueError: invalid literal for int():
      >>> int("2\n\n2")
      ValueError: invalid literal for int(): 2
      
      2
      
      Also report the base used, to avoid:
      
      ValueError: invalid literal for int(): 2
      
      They now report:
      
      >>> int("")
      ValueError: invalid literal for int() with base 10: ''
      >>> int("2\n\n2")
      ValueError: invalid literal for int() with base 10: '2\n\n2'
      >>> int("2", 2)
      ValueError: invalid literal for int() with base 2: '2'
      
      (Reporting the base could be avoided when base is 10, which is the default,
      but hrm.) Another effect of these changes is that the errormessage can be
      longer; before, it was cut off at about 250 characters. Now, it can be up to
      four times as long, as the unrepr'ed string is cut off at 200 characters,
      instead.
      
      No tests were added or changed, since testing for exact errormsgs is (pardon
      the pun) somewhat errorprone, and I consider not testing the exact text
      preferable. The actually changed code is tested frequent enough in the
      test_builtin test as it is (120 runs for each of ints and longs.)
      2dfeda7a
    • Vinay Sajip's avatar
      StreamHandler now checks explicitly for None before using sys.stderr as the... · 05d19889
      Vinay Sajip authored
      StreamHandler now checks explicitly for None before using sys.stderr as the stream (see SF bug #1463840).
      05d19889
    • Tim Peters's avatar
      _Py_PrintReferenceAddresses,_Py_PrintReferences: · 970b5764
      Tim Peters authored
      interpolate PY_FORMAT_SIZE_T for refcount display
      instead of casting refcounts to long.
      
      I understand that gcc on some boxes delivers
      nuisance warnings about this, but if any new ones
      appear because of this they'll get fixed by magic
      when the others get fixed.
      970b5764
    • Andrew M. Kuchling's avatar
      Complete the ElementTree section · f75cd751
      Andrew M. Kuchling authored
      f75cd751