[ python-Bugs-1650090 ] doctest doesn't find nested functions

2007-02-02 Thread SourceForge.net
Bugs item #1650090, was opened at 2007-02-01 19:20
Message generated for change (Settings changed) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650090&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Daniel Brown (danb37)
>Assigned to: Tim Peters (tim_one)
Summary: doctest doesn't find nested functions

Initial Comment:
If a nested function has doctests, they won't be run:
{{{
def f():
  '''
  >>> 'a'
  'a'
  '''

  def g():
'''
>>> 'a'
'b'
'''
pass

  pass
}}}

DocTestFinder will only find f's doctest and won't recurse to find g's, 
surprising the programmer when they (hopefully) discover that their inner 
doctest is incorrect!

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650090&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1650899 ] sys.excepthook does not work with -m command line switch

2007-02-02 Thread SourceForge.net
Bugs item #1650899, was opened at 2007-02-02 21:27
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650899&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Miki Tebeka (tebeka)
Assigned to: Nobody/Anonymous (nobody)
Summary: sys.excepthook does not work with -m command line switch

Initial Comment:
crashlog.py is the following:
  import sys

  def excepthook(type, value, traceback):
  print "BUMMER"

  sys.excepthook = excepthook

When crash.py is like:
  import crashlog
  raise ValueError("so sad")

The it works as expected:
  [EMAIL PROTECTED] - 11:22] ~ $python crash.py 
  BUMMER
  [EMAIL PROTECTED] - 11:23] ~ $

However when I try to load crashlog using -m and leave crash.py like:
  raise ValueError("so sad")

The nothing (not even original excepthook is called):
  [EMAIL PROTECTED] - 11:23] ~ $python -m crashlog crash.py
  [EMAIL PROTECTED] - 11:25] ~ $



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650899&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1650903 ] PyFloat_FromString deprecated form

2007-02-02 Thread SourceForge.net
Bugs item #1650903, was opened at 2007-02-02 14:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650903&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Python 3000
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jim Jewett (jimjjewett)
Assigned to: Nobody/Anonymous (nobody)
Summary: PyFloat_FromString deprecated form

Initial Comment:
PyFloat_FromString takes two arguments, and the only purpose of the second is 
to avoid changing the API.

Extracts from Tim's 2000 comment:


Since we can't change the interface of a public API function, pend is still 
supported but now *officially* useless:  if pend is not NULL, *pend is set to 
NULL.


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650903&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1650899 ] sys.excepthook does not work with -m command line switch

2007-02-02 Thread SourceForge.net
Bugs item #1650899, was opened at 2007-02-02 21:27
Message generated for change (Comment added) made by tebeka
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650899&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Miki Tebeka (tebeka)
Assigned to: Nobody/Anonymous (nobody)
Summary: sys.excepthook does not work with -m command line switch

Initial Comment:
crashlog.py is the following:
  import sys

  def excepthook(type, value, traceback):
  print "BUMMER"

  sys.excepthook = excepthook

When crash.py is like:
  import crashlog
  raise ValueError("so sad")

The it works as expected:
  [EMAIL PROTECTED] - 11:22] ~ $python crash.py 
  BUMMER
  [EMAIL PROTECTED] - 11:23] ~ $

However when I try to load crashlog using -m and leave crash.py like:
  raise ValueError("so sad")

The nothing (not even original excepthook is called):
  [EMAIL PROTECTED] - 11:23] ~ $python -m crashlog crash.py
  [EMAIL PROTECTED] - 11:25] ~ $



--

>Comment By: Miki Tebeka (tebeka)
Date: 2007-02-02 21:42

Message:
Logged In: YES 
user_id=358087
Originator: YES

Didn't understand how -m works, my bad

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650899&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1646068 ] Dict lookups fail if sizeof(Py_ssize_t) < sizeof(long)

2007-02-02 Thread SourceForge.net
Bugs item #1646068, was opened at 2007-01-27 13:23
Message generated for change (Comment added) made by jimjjewett
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1646068&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
Status: Open
Resolution: None
Priority: 6
Private: No
Submitted By: ked-tao (ked-tao)
Assigned to: Tim Peters (tim_one)
Summary: Dict lookups fail if sizeof(Py_ssize_t) < sizeof(long)

Initial Comment:
Portation problem.

Include/dictobject.h defines PyDictEntry.me_hash as a Py_ssize_t. Everywhere 
else uses a C 'long' for hashes.

On the system I'm porting to, ints and pointers (and ssize_t) are 32-bit, but 
longs and long longs are 64-bit. Therefore, the assignments to me_hash truncate 
the hash and subsequent lookups fail.

I've changed the definition of me_hash to 'long' and (in Objects/dictobject.c) 
removed the casting from the various assignments and changed the definition of 
'i' in dict_popitem(). This has fixed my immediate problems, but I guess I've 
just reintroduced whatever problem it got changed for. The comment in the 
header says:

/* Cached hash code of me_key.  Note that hash codes are C longs.
 * We have to use Py_ssize_t instead because dict_popitem() abuses
 * me_hash to hold a search finger.
 */

... but that doesn't really explain what it is about dict_popitem() that 
requires the different type.

Thanks. Kev.

--

Comment By: Jim Jewett (jimjjewett)
Date: 2007-02-02 15:20

Message:
Logged In: YES 
user_id=764593
Originator: NO

The whole point of a hash is that if it doesn't match, you can skip an
expensive comparison.  How big to make the hash is a tradeoff between how
much you'll waste calculating and storing it vs how often it will save a
"real" comparison.

The comment means that, as an implementation detail, popitem assumes it
can store a pointer there instead, so hashes need to be at least as big as
a pointer.  

Going to the larger of the two sizes will certainly solve your problem; it
just wastes some space, and maybe some time calculating the hash.  

If you want to get that space back, just make sure the truncation is
correct and consistent.  I *suspect* your problem is that when there is a
collision, either 

(1)  It is comparing a truncated value to an untruncated value, or
(2)  The perturbation to find the next slot is going wrong, because of
when the truncation happens.

--

Comment By: Georg Brandl (gbrandl)
Date: 2007-01-27 14:40

Message:
Logged In: YES 
user_id=849994
Originator: NO

This is your code, Tim.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1646068&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1621111 ] IDLE crashes on OS X 10.4 when "Preferences" selected

2007-02-02 Thread SourceForge.net
Bugs item #162, was opened at 2006-12-23 05:03
Message generated for change (Comment added) made by f_scholder
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=162&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Macintosh
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mick L (mehum)
Assigned to: Ronald Oussoren (ronaldoussoren)
Summary: IDLE crashes on OS X 10.4 when "Preferences" selected

Initial Comment:
When I select 'preferences' (on IDLE 1.2, Python 2.5)  or 'Configure IDLE' 
(IDLE 1.1.4, Python 2.4.4 and IDLE 1.0, Python 2.3.3), Python crashes as soon 
as the dialog box appears.

Terminal reports a "Segmentation fault" upon the crash.

My system is an iMac G5 with 1 GB ram running OS X v 10.4.8, Tcl/Tk 8.4.10, and 
seems otherwise stable.  

IDLE also appears stable until I select this option.

The Python crash log is attached.

Please, can anyone suggest what may be causing this problem?  Thank you.



--

Comment By: François Scholder (f_scholder)
Date: 2007-02-02 22:48

Message:
Logged In: YES 
user_id=1609867
Originator: NO

A similar problem arises with WinXP when trying to configure IDLE via the
"Options>Configure IDLE..." menu.

Clicking on the 'Ok' or 'Apply' buttons of the dialog seemingly has no
effect. However when closing the window by clicking on either the window
close button (top right 'X') or the 'Cancel' button, several bahaviors are
observed depending on how many times one has clicked on the 'Ok' and/or
'Cancel' buttons before:
- 0 clicks => expected behavior (dialog is closed, IDLE session is resumed
and working fine)
- 1 or 2 clicks => dialog is closed but the IDLE shell behaves as a text
editor instead of an interpreter
- 3 or more clicks => IDLE crashes...

Note: I'm running Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC
v.1310 32 bit (Intel)] on win32 -> WinXP SP2

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=162&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1621111 ] IDLE crashes on OS X 10.4 when "Preferences" selected

2007-02-02 Thread SourceForge.net
Bugs item #162, was opened at 2006-12-23 05:03
Message generated for change (Comment added) made by f_scholder
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=162&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Macintosh
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mick L (mehum)
Assigned to: Ronald Oussoren (ronaldoussoren)
Summary: IDLE crashes on OS X 10.4 when "Preferences" selected

Initial Comment:
When I select 'preferences' (on IDLE 1.2, Python 2.5)  or 'Configure IDLE' 
(IDLE 1.1.4, Python 2.4.4 and IDLE 1.0, Python 2.3.3), Python crashes as soon 
as the dialog box appears.

Terminal reports a "Segmentation fault" upon the crash.

My system is an iMac G5 with 1 GB ram running OS X v 10.4.8, Tcl/Tk 8.4.10, and 
seems otherwise stable.  

IDLE also appears stable until I select this option.

The Python crash log is attached.

Please, can anyone suggest what may be causing this problem?  Thank you.



--

Comment By: François Scholder (f_scholder)
Date: 2007-02-02 22:55

Message:
Logged In: YES 
user_id=1609867
Originator: NO

Erratum:

A similar problem arises with WinXP when trying to configure IDLE via the
"Options>Configure IDLE..." menu.

Clicking on the 'Ok' or 'Apply' buttons of the dialog seemingly has no
effect. However when closing the window by clicking on either the window
close button (top right 'X') or the 'Cancel' button, several bahaviors
are
observed depending on how many times one has clicked on the 'Ok' and/or
>'Apply'< buttons before:
- 0 clicks => expected behavior (dialog is closed, IDLE session is
resumed
and working fine)
- 1 or 2 clicks => dialog is closed but the IDLE shell behaves as a text
editor instead of an interpreter
- 3 or more clicks => IDLE crashes...

Note: I'm running Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC
v.1310 32 bit (Intel)] on win32 -> WinXP SP2

--

Comment By: François Scholder (f_scholder)
Date: 2007-02-02 22:48

Message:
Logged In: YES 
user_id=1609867
Originator: NO

A similar problem arises with WinXP when trying to configure IDLE via the
"Options>Configure IDLE..." menu.

Clicking on the 'Ok' or 'Apply' buttons of the dialog seemingly has no
effect. However when closing the window by clicking on either the window
close button (top right 'X') or the 'Cancel' button, several bahaviors are
observed depending on how many times one has clicked on the 'Ok' and/or
'Cancel' buttons before:
- 0 clicks => expected behavior (dialog is closed, IDLE session is resumed
and working fine)
- 1 or 2 clicks => dialog is closed but the IDLE shell behaves as a text
editor instead of an interpreter
- 3 or more clicks => IDLE crashes...

Note: I'm running Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC
v.1310 32 bit (Intel)] on win32 -> WinXP SP2

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=162&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com