[ python-Bugs-1326406 ] pdb breaks programs which import from __main__

2006-05-17 Thread SourceForge.net
Bugs item #1326406, was opened at 2005-10-13 21:23
Message generated for change (Comment added) made by isandler
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1326406&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: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Ilya Sandler (isandler)
Assigned to: Nobody/Anonymous (nobody)
Summary: pdb breaks programs which import from __main__

Initial Comment:
The following example illustrates the problem:

  bagira:~/python/dist/src/Lib> cat tt/xx
  hello=None
  import yy
  print "in xx:yy imported"

  bagira:~/python/dist/src/Lib> cat tt/yy.py
  from __main__ import hello
  print "in yy: yy imported "

this works by itself:

  bagira:~/python/dist/src/Lib> ../python tt/xx
  in yy: yy imported 
  in xx:yy imported

But breaks under pdb

 bagira:~/python/dist/src/Lib> ../python -m pdb tt/xx 
 > /home/ilya/python/dist/src/Lib/tt/xx(1)?()
 -> hello=None
  (Pdb) c
  Traceback (most recent call last):
   File "/home/ilya/python/dist/src/Lib/pdb.py", line
1057, in main
pdb._runscript(mainpyfile)
   File "/home/ilya/python/dist/src/Lib/pdb.py", line
982, in   _runscript
 self.run(statement, globals=globals_, locals=locals_)
   File "/home/ilya/python/dist/src/Lib/bdb.py", line
367, in run
 exec cmd in globals, locals
   File "", line 1, in ?
   File "tt/xx", line 2, in ?
 import yy
   File "/home/ilya/python/dist/src/Lib/tt/yy.py", line
1, in ?
 from __main__ import hello
 ImportError: cannot import name hello
 Uncaught exception. Entering post mortem debugging
 Running 'cont' or 'step' will restart the program
  > /home/ilya/python/dist/src/Lib/tt/yy.py(1)?()
 -> from __main__ import hello




--

>Comment By: Ilya Sandler (isandler)
Date: 2006-05-17 17:53

Message:
Logged In: YES 
user_id=971153

I have submitted a patch #1429539 for this


--

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



[ python-Bugs-1490688 ] %g incorrect conversion

2006-05-17 Thread SourceForge.net
Bugs item #1490688, was opened at 2006-05-18 04:31
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=1490688&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.4
Status: Open
Resolution: None
Priority: 5
Submitted By: paul rubin (phr)
Assigned to: Nobody/Anonymous (nobody)
Summary: %g incorrect conversion

Initial Comment:
According to
http://docs.python.org/lib/typesseq-strings.html

%g is the same as %f or %e depending on the exponent. 
Test:

Python 2.4.1 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2

>>> x=.123999
>>> '%.4f'%x
'0.1240'
>>> '%.4g'%x
'0.124'
>>>

These are not the same.


--

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