[ python-Feature Requests-1237678 ] add a note to eval and exec to not use it when possible

2005-07-13 Thread SourceForge.net
Feature Requests item #1237678, was opened at 2005-07-13 18:45
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1237678&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: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Reinhold Birkenfeld (birkenfeld)
Assigned to: Nobody/Anonymous (nobody)
Summary: add a note to eval and exec to not use it when possible

Initial Comment:
The docs for eval and exec should have pointers how to
avoid them, by e.g. using locals(), globals(), getattr,
setattr etc.

Many questions pop up on c.l.py which could be answered
by this.

--

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



[ python-Feature Requests-1237680 ] add dedent() string method

2005-07-13 Thread SourceForge.net
Feature Requests item #1237680, was opened at 2005-07-13 18:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1237680&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: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Reinhold Birkenfeld (birkenfeld)
Assigned to: Nobody/Anonymous (nobody)
Summary: add dedent() string method

Initial Comment:
textwrap.dedent() is very useful for in-code multi-line
string literals. However, as it is "hidden" in a module
it does not really fit in, people don't use it and
instead propose new string literal syntax for "dedented".

str.dedent with an efficient C implementation would
solve this.

--

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



[ python-Bugs-1237697 ] link path probs on OSX re: Tcl, Tk & fink's /sw

2005-07-13 Thread SourceForge.net
Bugs item #1237697, was opened at 2005-07-13 10:06
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=1237697&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: Build
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: blakers (blakers)
Assigned to: Nobody/Anonymous (nobody)
Summary: link path probs on OSX re: Tcl, Tk & fink's /sw

Initial Comment:
hi all,

i'm bldg Python 2.4.1 on OSX 10.4.1 ...

i've installed a late version of Tcl/Tk framework in:

   /Library/Frameworks/Tcl.framework
   /Library/Frameworks/Tk.framework

iiuc, these frameworks/libs are SUPPOSED to be searched PRIOR to /
System/Library/Frameworks ...

i've installed the Fink dev env in "/sw"

the Fink ev is 'disabled' o my box ... i.e., "/sw" is NOT in my path ...



that said, the Python build 'insists' on building against:

(1) the /System/... Tcl & Tk frameworks
(2) libs/includes in /sw/... (e.g., ndbm.h ...)

correcting the problem is INSENSITIVE to discreet inclusion of /Library/
Frameworks in LD_LIBRARY_PATH/DYLD_LIBRARY_PATH

only the build time spec'n of:

   setenv LDFLAGS "-L/Library/Frameworks -framework Tcl -framework 
Tk"

seems to do the trick ...

as for /sw, only a:

mv /sw /swTMP
( ... build ...)
mv /swTMP /sw

seems to work.

cheers,

richard


--

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



[ python-Bugs-1237697 ] link path probs on OSX re: Tcl, Tk & fink's /sw

2005-07-13 Thread SourceForge.net
Bugs item #1237697, was opened at 2005-07-13 10:06
Message generated for change (Comment added) made by blakers
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1237697&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: Build
Group: Python 2.4
Status: Open
Resolution: None
>Priority: 7
Submitted By: blakers (blakers)
Assigned to: Nobody/Anonymous (nobody)
Summary: link path probs on OSX re: Tcl, Tk & fink's /sw

Initial Comment:
hi all,

i'm bldg Python 2.4.1 on OSX 10.4.1 ...

i've installed a late version of Tcl/Tk framework in:

   /Library/Frameworks/Tcl.framework
   /Library/Frameworks/Tk.framework

iiuc, these frameworks/libs are SUPPOSED to be searched PRIOR to /
System/Library/Frameworks ...

i've installed the Fink dev env in "/sw"

the Fink ev is 'disabled' o my box ... i.e., "/sw" is NOT in my path ...



that said, the Python build 'insists' on building against:

(1) the /System/... Tcl & Tk frameworks
(2) libs/includes in /sw/... (e.g., ndbm.h ...)

correcting the problem is INSENSITIVE to discreet inclusion of /Library/
Frameworks in LD_LIBRARY_PATH/DYLD_LIBRARY_PATH

only the build time spec'n of:

   setenv LDFLAGS "-L/Library/Frameworks -framework Tcl -framework 
Tk"

seems to do the trick ...

as for /sw, only a:

mv /sw /swTMP
( ... build ...)
mv /swTMP /sw

seems to work.

cheers,

richard


--

>Comment By: blakers (blakers)
Date: 2005-07-13 10:56

Message:
Logged In: YES 
user_id=564069

1st, i "lied" earlier ... i'm building on OSX 10.4.2, not 10.4.1.

AND, apparently, i still have a problem ... the WRONG HEADERS.

even with:

setenv CPPFLAGS "-I/Library/Frameworks/Tcl.framework/Headers -I/
Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -I/
Library/Frameworks/Tk.framework/Headers -I/Library/Frameworks/
Tk.framework/Versions/Current/PrivateHeaders"

set prior to configure, the build 'make' STILL complains abt:

building '_tkinter' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wno-
long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -
DWITH_APPINIT=1 -I/System/Library/Frameworks/Tcl.framework/Headers -I/
System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -
I/System/Library/Frameworks/Tk.framework/Headers -I/System/Library/
Frameworks/Tk.framework/Versions/Current/PrivateHeaders -I/usr/X11R6/
include -I. -I/usr/ports/Python-2.4.1/./Include -I/usr/ports/Python-2.4.1/./Mac/
Include -I/usr/local/include -I/usr/ports/Python-2.4.1/Include -I/usr/ports/
Python-2.4.1 -c /usr/ports/Python-2.4.1/Modules/_tkinter.c -o build/
temp.darwin-8.2.0-Power_Macintosh-2.4/_tkinter.o -framework Tcl -
framework Tk
In file included from /System/Library/Frameworks/Tk.framework/Headers/tk.h:
96,
 from /usr/ports/Python-2.4.1/Modules/_tkinter.c:67:
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:140: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:343: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:462: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:480: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:505: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:506: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:518: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:531: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:1065: 
warning: function declaration isn't a prototype
powerpc-apple-darwin8-gcc-4.0.0: -framework: linker input file unused 
because linking not done
powerpc-apple-darwin8-gcc-4.0.0: Tcl: linker input file unused because 
linking not done
powerpc-apple-darwin8-gcc-4.0.0: -framework: linker input file unused 
because linking not done
powerpc-apple-darwin8-gcc-4.0.0: Tk: linker input file unused because 
linking not done
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wno-
long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -
DWITH_APPINIT=1 -I/System/Library/Frameworks/Tcl.framework/Headers -I/
System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -
I/System/Library/Frameworks/Tk.framework/Headers -I/System/Library/
Frameworks/Tk.framework/Versions/Current/PrivateHeaders -I/usr/X11R6/
include -I. -I/usr/ports/Python-2.4.1/./Include -I/usr/ports/Python-2.4.1/./Mac/
Include -I/usr/local/include -I/usr/ports/Python-2.4.1/Includ

[ python-Bugs-1237697 ] link path probs on OSX re: Tcl, Tk & fink's /sw

2005-07-13 Thread SourceForge.net
Bugs item #1237697, was opened at 2005-07-13 10:06
Message generated for change (Comment added) made by blakers
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1237697&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: Build
Group: Python 2.4
Status: Open
Resolution: None
Priority: 7
Submitted By: blakers (blakers)
Assigned to: Nobody/Anonymous (nobody)
Summary: link path probs on OSX re: Tcl, Tk & fink's /sw

Initial Comment:
hi all,

i'm bldg Python 2.4.1 on OSX 10.4.1 ...

i've installed a late version of Tcl/Tk framework in:

   /Library/Frameworks/Tcl.framework
   /Library/Frameworks/Tk.framework

iiuc, these frameworks/libs are SUPPOSED to be searched PRIOR to /
System/Library/Frameworks ...

i've installed the Fink dev env in "/sw"

the Fink ev is 'disabled' o my box ... i.e., "/sw" is NOT in my path ...



that said, the Python build 'insists' on building against:

(1) the /System/... Tcl & Tk frameworks
(2) libs/includes in /sw/... (e.g., ndbm.h ...)

correcting the problem is INSENSITIVE to discreet inclusion of /Library/
Frameworks in LD_LIBRARY_PATH/DYLD_LIBRARY_PATH

only the build time spec'n of:

   setenv LDFLAGS "-L/Library/Frameworks -framework Tcl -framework 
Tk"

seems to do the trick ...

as for /sw, only a:

mv /sw /swTMP
( ... build ...)
mv /swTMP /sw

seems to work.

cheers,

richard


--

>Comment By: blakers (blakers)
Date: 2005-07-13 11:32

Message:
Logged In: YES 
user_id=564069

1st, i "lied" earlier ... i'm building on OSX 10.4.2, not 10.4.1.

AND, apparently, i still have a problem ... the WRONG HEADERS.

even with:

setenv CPPFLAGS "-I/Library/Frameworks/Tcl.framework/Headers -I/
Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -I/
Library/Frameworks/Tk.framework/Headers -I/Library/Frameworks/
Tk.framework/Versions/Current/PrivateHeaders"

set prior to configure, the build 'make' STILL complains abt:

building '_tkinter' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wno-
long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -
DWITH_APPINIT=1 -I/System/Library/Frameworks/Tcl.framework/Headers -I/
System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -
I/System/Library/Frameworks/Tk.framework/Headers -I/System/Library/
Frameworks/Tk.framework/Versions/Current/PrivateHeaders -I/usr/X11R6/
include -I. -I/usr/ports/Python-2.4.1/./Include -I/usr/ports/Python-2.4.1/./Mac/
Include -I/usr/local/include -I/usr/ports/Python-2.4.1/Include -I/usr/ports/
Python-2.4.1 -c /usr/ports/Python-2.4.1/Modules/_tkinter.c -o build/
temp.darwin-8.2.0-Power_Macintosh-2.4/_tkinter.o -framework Tcl -
framework Tk
In file included from /System/Library/Frameworks/Tk.framework/Headers/tk.h:
96,
 from /usr/ports/Python-2.4.1/Modules/_tkinter.c:67:
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:140: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:343: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:462: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:480: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:505: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:506: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:518: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:531: warning: 
function declaration isn't a prototype
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:1065: 
warning: function declaration isn't a prototype
powerpc-apple-darwin8-gcc-4.0.0: -framework: linker input file unused 
because linking not done
powerpc-apple-darwin8-gcc-4.0.0: Tcl: linker input file unused because 
linking not done
powerpc-apple-darwin8-gcc-4.0.0: -framework: linker input file unused 
because linking not done
powerpc-apple-darwin8-gcc-4.0.0: Tk: linker input file unused because 
linking not done
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wno-
long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -
DWITH_APPINIT=1 -I/System/Library/Frameworks/Tcl.framework/Headers -I/
System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -
I/System/Library/Frameworks/Tk.framework/Headers -I/System/Library/
Frameworks/Tk.framework/Versions/Current/PrivateHeaders -I/usr/X11R6/
include -I. -I/usr/ports/Python-2.4.1/./Include -I/usr/ports/Python-2.4.1/./Mac/
Include -I/usr/local/include -I/usr/ports/Python-2.4.1/Include

[ python-Feature Requests-1237678 ] add a note to eval and exec to not use it when possible

2005-07-13 Thread SourceForge.net
Feature Requests item #1237678, was opened at 2005-07-13 11:45
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1237678&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: Documentation
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Reinhold Birkenfeld (birkenfeld)
Assigned to: Nobody/Anonymous (nobody)
Summary: add a note to eval and exec to not use it when possible

Initial Comment:
The docs for eval and exec should have pointers how to
avoid them, by e.g. using locals(), globals(), getattr,
setattr etc.

Many questions pop up on c.l.py which could be answered
by this.

--

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 16:45

Message:
Logged In: YES 
user_id=80475

This should not be in the docs.  Both eval() and exec are
legitmate parts of the language with valid use cases. 
Avoidance of eval() and exec is a comp.lang.python security
cult.

If you feel the need, write a FAQ entry and submit it to
Andrew.  The entry should be neautrally worded with an
informative note on the security risks of blindly running
untrusted code and will a short listing of faster or more
secure approaches for common use cases.  Also, mention the
input() includes an implicit call to eval().

--

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



[ python-Feature Requests-1237680 ] add dedent() string method

2005-07-13 Thread SourceForge.net
Feature Requests item #1237680, was opened at 2005-07-13 11:48
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1237680&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: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Reinhold Birkenfeld (birkenfeld)
Assigned to: Nobody/Anonymous (nobody)
Summary: add dedent() string method

Initial Comment:
textwrap.dedent() is very useful for in-code multi-line
string literals. However, as it is "hidden" in a module
it does not really fit in, people don't use it and
instead propose new string literal syntax for "dedented".

str.dedent with an efficient C implementation would
solve this.

--

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 16:53

Message:
Logged In: YES 
user_id=80475

-1 

* Being a top level function in a module doesn't count as
hidden.  This is no more hidden than collections.deque,
glob.glob, or re.sub.

* The API requirements are looser in a textwrap context. 
For a string method, there would need to be a universally
useful decision about how to handle mixed spaces and tabs
and whether the first line of a triple-quoted string would
be handled differently.  Am not sure if universal newlines
present any additional issues.

* The world-view of the string module is character oriented,
not line oriented.  A dedent method() is not a perfect fit.

* While the topic comes up every few years, in general,
there is no user demand for this.

--

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



[ python-Feature Requests-1232073 ] Links to tutorials and howtos from references

2005-07-13 Thread SourceForge.net
Feature Requests item #1232073, was opened at 2005-07-04 03:28
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1232073&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: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Hoffman (hoffmanm)
Assigned to: Nobody/Anonymous (nobody)
Summary: Links to tutorials and howtos from references

Initial Comment:
I see many people on comp.lang.python who are
frustrated by the existing documentation, which is
written at an advanced level for total beginners. It
might aid in discoverability of the tutorial and howtos
if more "See also" links were placed in language and
library reference pages. For example:

 could link
to . This would
probably reduce the number of basic re questions on
c.l.p and tutor, and make it easier to learn the
language and stdlib.

I'll submit my own patches as I have time.

--

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 16:57

Message:
Logged In: YES 
user_id=80475

-1 The reference docs need to remain loosely coupled or
decoupled from the how-tos and tutorial. Links in the other
direction are okay (the beginner's guides and overviews may
reference the detailed docs).

If you're interested in submitting docs patches, it would be
nice to get the how-to guides up-to-date.

--

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



[ python-Feature Requests-1226256 ] Add Jason Orendorff's path module to stdlib

2005-07-13 Thread SourceForge.net
Feature Requests item #1226256, was opened at 2005-06-23 08:26
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1226256&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: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Michael Hoffman (hoffmanm)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add Jason Orendorff's path module to stdlib

Initial Comment:
Jason Orendorff has produced an excellent path module
which has an OOP approach to path, directory, and file
manipulation, as well as including some new convenience
functions. In my opinion, it allows much more Pythonic
path manipulation than the functions in os and os.path.
It is quite stable and includes unit tests. I and many
others have been using it for years.

http://www.jorendorff.com/articles/python/path/

I am requesting that it be added to the stdlib.

--

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 16:58

Message:
Logged In: YES 
user_id=80475

Guido was clear that an RFE is insufficient.  A PEP is
required if this is to advance.

--

Comment By: Michael Hoffman (hoffmanm)
Date: 2005-07-04 03:25

Message:
Logged In: YES 
user_id=987664

Significant discussion on python-dev in this thread:

http://mail.python.org/pipermail/python-dev/2005-June/054438.html

--

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



[ python-Feature Requests-1232073 ] Links to tutorials and howtos from references

2005-07-13 Thread SourceForge.net
Feature Requests item #1232073, was opened at 2005-07-04 08:28
Message generated for change (Comment added) made by hoffmanm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1232073&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: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Hoffman (hoffmanm)
Assigned to: Nobody/Anonymous (nobody)
Summary: Links to tutorials and howtos from references

Initial Comment:
I see many people on comp.lang.python who are
frustrated by the existing documentation, which is
written at an advanced level for total beginners. It
might aid in discoverability of the tutorial and howtos
if more "See also" links were placed in language and
library reference pages. For example:

 could link
to . This would
probably reduce the number of basic re questions on
c.l.p and tutor, and make it easier to learn the
language and stdlib.

I'll submit my own patches as I have time.

--

>Comment By: Michael Hoffman (hoffmanm)
Date: 2005-07-13 22:05

Message:
Logged In: YES 
user_id=987664

Why? There are already many links to external documents
(including howtos) and even dead-tree books in the reference
docs. Try Googling for .

This would definitely be helpful for beginners, and I don't
see what the harm is.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 21:57

Message:
Logged In: YES 
user_id=80475

-1 The reference docs need to remain loosely coupled or
decoupled from the how-tos and tutorial. Links in the other
direction are okay (the beginner's guides and overviews may
reference the detailed docs).

If you're interested in submitting docs patches, it would be
nice to get the how-to guides up-to-date.

--

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



[ python-Feature Requests-1214675 ] module warnings lacks a remove filter function

2005-07-13 Thread SourceForge.net
Feature Requests item #1214675, was opened at 2005-06-04 02:37
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1214675&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: Torsten Bronger (bronger)
Assigned to: Nobody/Anonymous (nobody)
Summary: module warnings lacks a remove filter function

Initial Comment:
In the module warnings, there is no function for
removing certain items from the list of warnings
filters.  The only options are to empty the list
completely or to manipulate the warnings.filters list
directly, both of which is unfortunate in my opinion.

I attached a file with a removefilter() function.  I
don't know how safe it is to complete regular
expressions, however, it works nicely for me.

--

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 17:14

Message:
Logged In: YES 
user_id=80475

Whether or not the use case is common is irrelevant if the
solution is laced with problems (we don't add "works most of
the time" functions).  Am rejecting the removefilter()
proposal.  It doesn't scale-up for complex programs with
multiple modules each using their own warning filters.  It
is too easy for innocuous looking code to violate another
module's invariants.  This is doubly true in a
multi-threaded environment.

+1 on the proposal for a Py2.5 context manager solution. 
That proposal is workable because the CM can specifically
id() the filter that it added and later remove that exact
entry if still present -- this will work even other modules
have loaded an equivalent filter.  To work in a threaded
environement, the removal sequence should use a lock.

--

Comment By: Chris Connett (cconnett)
Date: 2005-07-08 13:53

Message:
Logged In: YES 
user_id=1140166

ISTM the most common use case for this would be to set up
some filter, perform some operation, then remove the filter.
 In this case, the removal wouldn't be far from the
insertion, so it might not be unreasonable to keep around a
reference to the added filter and remove it by identity when
it's no longer needed ... if such a reference were available
that is!  As it stands, one does not get back a reference to
the filter tuple added by filterwarnings(), so the only
options left are to immediately grab warnings.filters[0], or
construct one's own filter tuple manually (yech!).  Some way
should be provided to work in this case at least.

As an aside, with 2.5's proposed context managers, a filter
context could be added to this module so that a filter could
be added and removed around the operation with a 'with' block.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-06-26 23:22

Message:
Logged In: YES 
user_id=80475

I'm concerned that removefilter() may not work well in the 
presence of multiple modules that use the warnings module.  It 
may be difficult to make sure the one removed wasn't 
subsequently added another module.  Also, the issue is 
compounded because the order of filter application is important.

--

Comment By: Michael Hudson (mwh)
Date: 2005-06-04 07:48

Message:
Logged In: YES 
user_id=6656

Pfft, this isn't Java!

I'm not sure it should be done with impunity, but as a documented 
interface it makes perfect sense to me.

--

Comment By: Torsten Bronger (bronger)
Date: 2005-06-04 05:35

Message:
Logged In: YES 
user_id=442234

It's simpler of course.  However, if it's relatively easy to
avoid, a module user should not manipulate module data
structures directly, I think.

--

Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-06-04 04:33

Message:
Logged In: YES 
user_id=1188172

I don't know, but wouldn't it be simpler to just document
the warnings.filters attribute so that people know how to
manipulate the list of filters?

--

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



[ python-Feature Requests-1216944 ] Add Error Code Dictionary to urllib2

2005-07-13 Thread SourceForge.net
Feature Requests item #1216944, was opened at 2005-06-08 04:45
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1216944&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: Accepted
Priority: 5
Submitted By: Mike Foord (mjfoord)
>Assigned to: Reinhold Birkenfeld (birkenfeld)
Summary: Add Error Code Dictionary to urllib2

Initial Comment:
In order to properly handle 'HTTPError's from 
urllib2.urlopen you need to map error codes to an error 
message.

I suggest the addition of the following dictionary to do 
that  :

# Table mapping response codes to messages; 
entries have the
# form {code: (shortmessage, longmessage)}.
httpresponses = {
100: ('Continue', 'Request received, please 
continue'),
101: ('Switching Protocols',
  'Switching to new protocol; obey Upgrade 
header'),

200: ('OK', 'Request fulfilled, document follows'),
201: ('Created', 'Document created, URL follows'),
202: ('Accepted',
  'Request accepted, processing continues off-
line'),
203: ('Non-Authoritative Information', 'Request 
fulfilled from cache'),
204: ('No response', 'Request fulfilled, nothing 
follows'),
205: ('Reset Content', 'Clear input form for further 
input.'),
206: ('Partial Content', 'Partial content follows.'),

300: ('Multiple Choices',
  'Object has several resources -- see URI list'),
301: ('Moved Permanently', 'Object moved 
permanently -- see URI list'),
302: ('Found', 'Object moved temporarily -- see URI 
list'),
303: ('See Other', 'Object moved -- see Method 
and URL list'),
304: ('Not modified',
  'Document has not changed since given time'),
305: ('Use Proxy',
  'You must use proxy specified in Location to 
access this '
  'resource.'),
307: ('Temporary Redirect',
  'Object moved temporarily -- see URI list'),

400: ('Bad request',
  'Bad request syntax or unsupported method'),
401: ('Unauthorized',
  'No permission -- see authorization schemes'),
402: ('Payment required',
  'No payment -- see charging schemes'),
403: ('Forbidden',
  'Request forbidden -- authorization will not 
help'),
404: ('Not Found', 'Nothing matches the given URI'),
405: ('Method Not Allowed',
  'Specified method is invalid for this server.'),
406: ('Not Acceptable', 'URI not available in 
preferred format.'),
407: ('Proxy Authentication Required', 'You must 
authenticate with '
  'this proxy before proceeding.'),
408: ('Request Time-out', 'Request timed out; try 
again later.'),
409: ('Conflict', 'Request conflict.'),
410: ('Gone',
  'URI no longer exists and has been 
permanently removed.'),
411: ('Length Required', 'Client must specify 
Content-Length.'),
412: ('Precondition Failed', 'Precondition in 
headers is false.'),
413: ('Request Entity Too Large', 'Entity is too 
large.'),
414: ('Request-URI Too Long', 'URI is too long.'),
415: ('Unsupported Media Type', 'Entity body in 
unsupported format.'),
416: ('Requested Range Not Satisfiable',
  'Cannot satisfy request range.'),
417: ('Expectation Failed',
  'Expect condition could not be satisfied.'),

500: ('Internal error', 'Server got itself in trouble'),
501: ('Not Implemented',
  'Server does not support this operation'),
502: ('Bad Gateway', 'Invalid responses from 
another server/proxy.'),
503: ('Service temporarily overloaded',
  'The server cannot process the request due to 
a high load'),
504: ('Gateway timeout',
  'The gateway server did not receive a timely 
response'),
505: ('HTTP Version not supported', 'Cannot fulfill 
request.'),
}

--

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 17:24

Message:
Logged In: YES 
user_id=80475

Reinfeld, you are welcome to put this in.

Pay attention to the little details.  Look-up the http
protocol spec and use the exact spelling and exact
upper/lower letter case.  

Only include the second field of the tuple if it is
standard.  I quickly looked at a couple of different sources
and found that the "meaning" field was worded diffferently.
 If there is not a standard word-for-word official
definition, then leave that part out and just have a simple
mapping:  {500: "Internal Error", 501: "Not Implemented, ...}.


--

[ python-Feature Requests-1232073 ] Links to tutorials and howtos from references

2005-07-13 Thread SourceForge.net
Feature Requests item #1232073, was opened at 2005-07-04 03:28
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1232073&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: Documentation
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Michael Hoffman (hoffmanm)
Assigned to: Nobody/Anonymous (nobody)
Summary: Links to tutorials and howtos from references

Initial Comment:
I see many people on comp.lang.python who are
frustrated by the existing documentation, which is
written at an advanced level for total beginners. It
might aid in discoverability of the tutorial and howtos
if more "See also" links were placed in language and
library reference pages. For example:

 could link
to . This would
probably reduce the number of basic re questions on
c.l.p and tutor, and make it easier to learn the
language and stdlib.

I'll submit my own patches as I have time.

--

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 19:35

Message:
Logged In: YES 
user_id=80475

Sorry, I do not think this is a correct solution. 
Garbaging-up the authoritative references with more links
does not make regexps any less challenging.  

Both the how-tos and tutorial are top level entries in the
docs.  They are not hidden.  Also, users can turn to many
other places besides the how-tos and tutorials which are not
comprehensive and not unique -- there are tons of beginner
guides (on-line and off).

There is no doubt that the docs could be improved, but other
appoaches need to be taken.  There is no straight-forward
transformation of what we have now into a guide that can
teach people all about programming and how best to use the
available tools.  For better or worse, that task has been
left to third-party guides (Dive into Python, Python & XML,
Python in a Nutshell, Python and TkInter, etc).  Nothing we
can do can easily substitute for any of those.  The docs
cannot and should not purport to do otherwise.

--

Comment By: Michael Hoffman (hoffmanm)
Date: 2005-07-13 17:05

Message:
Logged In: YES 
user_id=987664

Why? There are already many links to external documents
(including howtos) and even dead-tree books in the reference
docs. Try Googling for .

This would definitely be helpful for beginners, and I don't
see what the harm is.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 16:57

Message:
Logged In: YES 
user_id=80475

-1 The reference docs need to remain loosely coupled or
decoupled from the how-tos and tutorial. Links in the other
direction are okay (the beginner's guides and overviews may
reference the detailed docs).

If you're interested in submitting docs patches, it would be
nice to get the how-to guides up-to-date.

--

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



[ python-Feature Requests-1216944 ] Add Error Code Dictionary to urllib2

2005-07-13 Thread SourceForge.net
Feature Requests item #1216944, was opened at 2005-06-08 11:45
Message generated for change (Settings changed) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1216944&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: Closed
Resolution: Accepted
Priority: 5
Submitted By: Mike Foord (mjfoord)
Assigned to: Reinhold Birkenfeld (birkenfeld)
Summary: Add Error Code Dictionary to urllib2

Initial Comment:
In order to properly handle 'HTTPError's from 
urllib2.urlopen you need to map error codes to an error 
message.

I suggest the addition of the following dictionary to do 
that  :

# Table mapping response codes to messages; 
entries have the
# form {code: (shortmessage, longmessage)}.
httpresponses = {
100: ('Continue', 'Request received, please 
continue'),
101: ('Switching Protocols',
  'Switching to new protocol; obey Upgrade 
header'),

200: ('OK', 'Request fulfilled, document follows'),
201: ('Created', 'Document created, URL follows'),
202: ('Accepted',
  'Request accepted, processing continues off-
line'),
203: ('Non-Authoritative Information', 'Request 
fulfilled from cache'),
204: ('No response', 'Request fulfilled, nothing 
follows'),
205: ('Reset Content', 'Clear input form for further 
input.'),
206: ('Partial Content', 'Partial content follows.'),

300: ('Multiple Choices',
  'Object has several resources -- see URI list'),
301: ('Moved Permanently', 'Object moved 
permanently -- see URI list'),
302: ('Found', 'Object moved temporarily -- see URI 
list'),
303: ('See Other', 'Object moved -- see Method 
and URL list'),
304: ('Not modified',
  'Document has not changed since given time'),
305: ('Use Proxy',
  'You must use proxy specified in Location to 
access this '
  'resource.'),
307: ('Temporary Redirect',
  'Object moved temporarily -- see URI list'),

400: ('Bad request',
  'Bad request syntax or unsupported method'),
401: ('Unauthorized',
  'No permission -- see authorization schemes'),
402: ('Payment required',
  'No payment -- see charging schemes'),
403: ('Forbidden',
  'Request forbidden -- authorization will not 
help'),
404: ('Not Found', 'Nothing matches the given URI'),
405: ('Method Not Allowed',
  'Specified method is invalid for this server.'),
406: ('Not Acceptable', 'URI not available in 
preferred format.'),
407: ('Proxy Authentication Required', 'You must 
authenticate with '
  'this proxy before proceeding.'),
408: ('Request Time-out', 'Request timed out; try 
again later.'),
409: ('Conflict', 'Request conflict.'),
410: ('Gone',
  'URI no longer exists and has been 
permanently removed.'),
411: ('Length Required', 'Client must specify 
Content-Length.'),
412: ('Precondition Failed', 'Precondition in 
headers is false.'),
413: ('Request Entity Too Large', 'Entity is too 
large.'),
414: ('Request-URI Too Long', 'URI is too long.'),
415: ('Unsupported Media Type', 'Entity body in 
unsupported format.'),
416: ('Requested Range Not Satisfiable',
  'Cannot satisfy request range.'),
417: ('Expectation Failed',
  'Expect condition could not be satisfied.'),

500: ('Internal error', 'Server got itself in trouble'),
501: ('Not Implemented',
  'Server does not support this operation'),
502: ('Bad Gateway', 'Invalid responses from 
another server/proxy.'),
503: ('Service temporarily overloaded',
  'The server cannot process the request due to 
a high load'),
504: ('Gateway timeout',
  'The gateway server did not receive a timely 
response'),
505: ('HTTP Version not supported', 'Cannot fulfill 
request.'),
}

--

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-07-14 08:41

Message:
Logged In: YES 
user_id=1188172

Okay. Checked in (without the second field) as
* Lib/urllib2.py r1.83
* Lib/test/test_urllib2.py r1.20
* Doc/lib/liburllib2.tex r1.23
* Misc/NEWS r1.1314

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-14 00:24

Message:
Logged In: YES 
user_id=80475

Reinfeld, you are welcome to put this in.

Pay attention to the little details.  Look-up the http
protocol spec and use the exact spelling and exact
upper/lower letter case.  

Only incl