[issue6879] misstatement in example explanation using raise

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Yes, that seems a good idea.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6919] Link CRT Statically

2009-09-16 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

This can't possibly work. Extension modules that also link with the CRT 
will thus end with a separate copy of the CRT global state, causing 
crashes.

--
nosy: +loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6412] Titlecase as defined in Unicode Case Mappings not followed

2009-09-16 Thread Gabriel Genellina

Changes by Gabriel Genellina :


--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6906] Tkinter sets an unicode environment variable on win32

2009-09-16 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

I cannot reproduce it with the python.org version:

Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit 
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
py> import Tkinter
py> import os
py> os.environ['TK_LIBRARY']
'D:\\apps\\Python26\\tcl\\tk8.5'
py> any(isinstance(value,unicode) for value in os.environ.values())
False

This might be an ActiveState issue.

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6920] IDLE 3 crashes on Ctrl+Space with "'utf8' codec can't decode bytes in position 0-1"

2009-09-16 Thread Yinon Ehrlich

New submission from Yinon Ehrlich :

on Ubuntu 8.04 - 
I downloaded the sources, then:
./configure --prefix=$HOME
make && make install

in ~/bin/idle3 when I press Ctrl+Space (according to the "Edit" menu,
should show completions) idle crashes with the following traceback:
Traceback (most recent call last):
  File "/homes/yinon/bin/idle3", line 5, in 
main()
  File "/homes/yinon/lib/python3.1/idlelib/PyShell.py", line 1420, in main
root.mainloop()
  File "/homes/yinon/lib/python3.1/tkinter/__init__.py", line 1009, in
mainloop
self.tk.mainloop(n)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1:
illegal encoding

--
components: IDLE
messages: 92667
nosy: Yinon
severity: normal
status: open
title: IDLE 3 crashes on Ctrl+Space with "'utf8' codec can't decode bytes in 
position 0-1"
type: crash
versions: Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6895] locale._parse_localename fails when localename does not contain encoding information

2009-09-16 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

If you provide a test case the patch has a greater chance of being 
accepted.

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6880] class needs forward reference

2009-09-16 Thread Gabriel Genellina

Changes by Gabriel Genellina :


--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6880] class needs forward reference

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, added a reference in r74818.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6876] readline documentation example error

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r74819.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6891] small typo in «unicode.rst»: « the Uniode APIs should be used» and broken URL

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Commented out the link for now in r74820.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6881] incorrect signature in doc for PyByteArray_Resize

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

I don't think the iterator type needs to be documented; many other such
iter types aren't.

Also, the argument names needn't match (since C doesn't have the notion
of keyword arguments).  They can be changed in the docs to be more
obvious than what the programmer chose :)

Would you like to fix the rest?

--
assignee: georg.brandl -> ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6885] pdb documentation shows running as script using "python" not "python3"

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed in r74821.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-09-16 Thread Gabriel Genellina

Changes by Gabriel Genellina :


--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2320] Race condition in subprocess using stdin

2009-09-16 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

@Robert: Yes, I'd say this is the same problem as issue4749

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6829] Frendly error message when inheriting from function

2009-09-16 Thread Gabriel Genellina

Changes by Gabriel Genellina :


--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6903] pdb - print in for iteration prints None after printing

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

This is caused by the special displayhook that pdb uses.

Normally, the displayhook suppresses output when it would print None;
this is not done in pdb's displayhook. This was a conscious decision,
because it can remove confusion when you try to get variable values like
this:

(Pdb) foo
(Pdb)

I'll ask python-dev for what is preferred.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6920] IDLE 3 crashes on Ctrl+Space with "'utf8' codec can't decode bytes in position 0-1"

2009-09-16 Thread Ezio Melotti

Ezio Melotti  added the comment:

This is a duplicate of #1028.

--
nosy: +ezio.melotti
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5621] Add description of special case to "Assignment statements" section

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

The patch submission was correct.

I edited the patch a bit, moved the example from augmented assignment to
the regular assignment and added a link from there to the new section.

Committed in r74822.

--
resolution: works for me -> accepted
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2009-09-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Isn't this better implemented via a codec error handler?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-16 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I agree that this is a release blocker for 2.6.3

--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6851] urllib.urlopen crashes in a thread on Snow Leopard

2009-09-16 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Agreed this should be a release blocker for 2.6.3

--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6918] ctypes compilation error on SnowLeopard

2009-09-16 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Agreed this should be a release blocker for 2.6.3

--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-16 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I'm willing to leave this as a release blocker for 2.6.3, but I will
re-evaluate it if no progress is made on it.

--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5672] Implement a way to change the python process name

2009-09-16 Thread Ask Solem

Ask Solem  added the comment:

Amaury Forgeot d'Arc, wrote:
  And I'd follow the same path: provide a way to build a launcher - 
  a .exe file that simply starts python with the given script.

Sounds good, but how would you expect to set the process name
for a subprocess, like a multiprocessing.Process? Make one shell script
for every process you want to launch and use exec? Maybe even dynamically 
create the scripts? This is not a solution.

--
nosy: +asksol

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6875] add os.close() suggestion to mkstemp documentation

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

That one has to close open files should be common knowledge.

And it's already documented that the filehandle returned is to be
treated as if coming from `os.open`, so the "isn't a file object" is
documented as well.

Insofar, I'm in agreement with David.

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6892] optparser example in optparse documentation is broken

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed (by adding the add_help_option=False argument to OptionParser) in
r74824.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6879] misstatement in example explanation using raise

2009-09-16 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed in r74825 (trunk) and r74827 (release26-maint), thanks!

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6919] Link CRT Statically

2009-09-16 Thread Georg Brandl

Changes by Georg Brandl :


--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-16 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

I'm not sure I'll be able to work on this again for a while after this
morning, so here's a patch.  I don't really understand how the exception
structs are involved here, so I don't really know why the patch works,
but it seems to.  If there's something wrong with it, someone else may
need to fix it in order to have it ready for 2.6.3.

--
keywords: +patch
Added file: http://bugs.python.org/file14896/less-deprecated-message.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6760] patch to subprocess docs to better explain Popen's 'args' argument

2009-09-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

We are trying to cut down on the number of "warning" directives in the
docs; I think a "note" directive would be appropriate for yours.

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1613573] xmlrpclib ServerProxy uses old httplib interface

2009-09-16 Thread anatoly techtonik

anatoly techtonik  added the comment:

Yep, the patch at #6267 is an extension of this one except for the last 
chunk where I also check if sockets are ssl-enabled. I am not sure why 
it was needed. It also may have been already fixed somewhere else. As 
this bug doesn't have any tests attached it may be considered closed for 
now.

Would be nice to see these fixes in Python 2.6 though as it is the 
default version that seems to go in Ubuntu 9.10

+import socket
+if not socket._have_ssl:
 raise NotImplementedError(
 "your version of httplib doesn't support HTTPS"
 )

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5672] Implement a way to change the python process name

2009-09-16 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

> prctl is not portable. I always thought that the premise of stdlib is to
> provide portable interfaces.  BSD, for example, uses setprocname instead
> of prctl.  Also, prctl does not modify the process name shown in "ps
> uxww". Here's how PostgreSQL does this: http://tinyurl.com/mhjuqc.

Many parts of the stdlib are not portable.  It is perfectly appropriate
for the stdlib to expose a low-level, platform-specific API directly and
in a way which makes the Python API similarly low-level and non-portable.

That's not to say that a cross-platform API cannot *also* be provided,
though, assuming the functionality can be implemented *somehow* on other
platforms.  So I agree with Martin.  prctl should be exposed as-is.  If
someone would also like to expose similar functionality on on other
platforms, great.  And if someone would like to provide a cross-platform
API based on these, also great.

--
nosy: +exarkun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6921] recursion wierdness ... related to variable scoping?

2009-09-16 Thread David Hanney

New submission from David Hanney :

I was playing about with ideas behind b-plus-trees
and found i python bug

the important bit of code is:




for p, k in enumerate(self.keys):
self.ptrs[p].dump(indent+1, kmin=lk, kmax=k)
print sindent + "(" + str(k) + ")"
lk = k

#
# python bug?
#
show_python_bug = len(sys.argv)>1
if show_python_bug:
#
# why not this?
assert p == len(self.keys)-1
else:
#
# why do I need this instead?
p = len(self.keys)-1


i'm expecting k to still be in scope and equal len(self.keys)-1
sometimes it is and sometimes it isn't (depending on recursion depth)

you can try it for yourselves as I attach the full program:

./btree.py
runs fine
./btree.py  show_python_bug
eventually breaks like this:

Traceback (most recent call last):
  File "./btree.py", line 235, in 
page.dump()
  File "./btree.py", line 223, in dump
self.ptrs[p+1].dump(indent+1, kmin=lk)
  File "./btree.py", line 223, in dump
self.ptrs[p+1].dump(indent+1, kmin=lk)
  File "./btree.py", line 223, in dump
self.ptrs[p+1].dump(indent+1, kmin=lk)
  File "./btree.py", line 217, in dump
assert p == len(self.keys)-1
UnboundLocalError: local variable 'p' referenced before assignment

... despite executing that code many times successfully before this
happens ... strange!

I hope you can figure it out and that this report proves helpful.

--
components: Interpreter Core
files: btree.py
messages: 92691
nosy: mrdiskodave
severity: normal
status: open
title: recursion wierdness ... related to variable scoping?
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14897/btree.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6877] enable compilation of readline module on Mac OS X 10.5 and 10.6

2009-09-16 Thread Zvezdan Petkovic

Zvezdan Petkovic  added the comment:

The patch `readline-libedit.patch` has the following problems:

- a typo causing an undefined variable error;
- a missing "#endif";
- it doesn't refer to the new __APPLE__ specific doc string anywhere.

It fails to compile `readline.c`. ::

Modules/readline.c:1073: error:
‘using_libedit_emultation’ undeclared (first use in this 
function)
Modules/readline.c:1059:1: error: unterminated #ifdef

The fixed patch is attached as `readline-libedit-2.patch` above.
Please review it.

There are also a few minor stylistic nits I took a liberty to fix.

In readline.c
=

Line 496
Formatted a block comment to a usual C style (used by other comments
it the patch, FWIW).

Line 505
The standard style in C (and C-like) languages is to *not* write a
space between a variable and a unary operator (e.g., "C++").
Changed it to::

idx--;

Lines 1085/86
Removed two unnecessary empty lines added by the first patch.
There's already one empty line in the original code to space an if
statement from the next line.

Line 1070
Line was longer than 79 characters (violates PEP-7).  Reformatted.


In setup.py
===

Line 561
A comment block was indented in the first patch and had lines longer
than 79 characters (violates PEP-8).  I refactored the code to avoid
repeating the same else statement twice.  This obviated the need to
indent the said comment block.

*Please review whether you agree with the refactoring*

Just out of curiosity: does anyone know why the first if statement that
tests for 'darwin' uses ``platform`` and the second one uses
``sys.platform``?  Couldn't we use ``platform`` in both of them?

--
Added file: http://bugs.python.org/file14899/readline-libedit-2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1613573] xmlrpclib ServerProxy uses old httplib interface

2009-09-16 Thread STINNER Victor

STINNER Victor  added the comment:

@techtonik: I don't think that testing socket._have_ssl is better than testing
for HTTPSConnection. socket._have_ssl might be True, whereas
HTTPSConnection is missing for a random reason. xmlrpclib uses
HTTPSConnection, not directly the socket library. HTTPSConnection may be
implemented using something else than socket / ssl.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6873] posix_lchown: possible overflow of uid, gid

2009-09-16 Thread Boya Sun

Boya Sun  added the comment:

Martin,

Corrected the patch accordingly. Can you verify whether the fix is
correct or not now? 

Boya

--
Added file: http://bugs.python.org/file14900/patch_6873.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-16 Thread darkspork

darkspork  added the comment:

I can confirm this as well. It also locks up when pasting text. The EDIT 
menu retains its glow, and the pasted text appears after a few seconds, 
along with another blank square window titled "idle". Idle then locks up. 
Using the scrollbar in any way (even by using the mousewheel) also locks 
up IDLE, although the window scrolls perfectly well.

--
nosy: +darkspork

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1613573] xmlrpclib ServerProxy uses old httplib interface

2009-09-16 Thread anatoly techtonik

anatoly techtonik  added the comment:

There should be a better way to do this check, because HTTPConnection 
method may exists, but HTTPConnection may be impossible, because of 
other reasons.

And I still would like to see this fix in Python 2.6 - too bad it hadn't 
enough attention before 2.6.

Flags like +wanted-2.6 like in FireFox bugzilla could really help to 
see/discuss critical parts to be included for everybody before it's too 
late. Should we stop development and dedicate a month or two on 
improving the process? =)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6903] pdb - print in for iteration prints None after printing

2009-09-16 Thread Mitchell Model

Mitchell Model  added the comment:

No problem with the None's -- I see your point about that. Just that  
maybe the alias example should point out that the Nones will be  
printed so people won't be surprised and try to figure out what's wrong.

 --- Mitchell

On Sep 16, 2009, at 5:56 AM, Georg Brandl wrote:

>
> Georg Brandl  added the comment:
>
> This is caused by the special displayhook that pdb uses.
>
> Normally, the displayhook suppresses output when it would print None;
> this is not done in pdb's displayhook. This was a conscious decision,
> because it can remove confusion when you try to get variable values  
> like
> this:
>
> (Pdb) foo
> (Pdb)
>
> I'll ask python-dev for what is preferred.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6903] pdb - print in for iteration prints None after printing

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Actually, Guido hates the Nones. :)  Fixed in r74839.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1613573] xmlrpclib ServerProxy uses old httplib interface

2009-09-16 Thread STINNER Victor

STINNER Victor  added the comment:

@techtonik: We wrote "HTTPConnection" twice. I don't really understand your
request. Do you think that the issue is fixed in Python trunk or not? If not,
please open a new issue since this issue is closed.

techtonik> And I still would like to see this fix in Python 2.6
techtonik> - too bad it hadn't enough attention before 2.6.

Python is developed for people working on Python in their free time. Vote for
an ticket is useless. If you want to see your fix faster in the subversion, 
follow
some rules:
 - explain correctly the issue
 - write a test
 - write a patch
 - explain your solution
 - fix your patches if needed after each patch review

You posted your patch the 2008-07-01, and the 2.6 final version was released
the 1st october. It was a little bit too late for the 2.6, but it may be 
included in
next 2.6.x release if it's easy to backport it. I also think that not enough 
people
are interested by XML-RPC + HTTPS.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1613573] xmlrpclib ServerProxy uses old httplib interface

2009-09-16 Thread STINNER Victor

Changes by STINNER Victor :


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1613573] xmlrpclib ServerProxy uses old httplib interface

2009-09-16 Thread STINNER Victor

STINNER Victor  added the comment:

@techtonik: You wrote "HTTPConnection" twice. I don't really understand your
request. Do you think that the issue is fixed in Python trunk or not? If not,
please open a new issue since this issue is closed.

techtonik> And I still would like to see this fix in Python 2.6
techtonik> - too bad it hadn't enough attention before 2.6.

Python is developed by people working on Python in their free time. IMHO,
voting for an ticket is useless. If you want to see your fix faster in the
subversion, follow some rules:
 - explain correctly the issue
 - write a test
 - write a patch
 - explain your solution
 - fix your patches if needed after each patch review

You posted your patch the 1st July 2008, and the 2.6 final version was released
the 1st october 2008. It was a little bit too late for the 2.6 (because of the
beta/RC releases), but it may be included in next 2.6.x release if it's easy to
backport it. I also think that not enough people are interested by XML-RPC +
HTTPS.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

2009-09-16 Thread Robert Lehmann

Robert Lehmann  added the comment:

If I understand you correctly, your proposal is the following: use
Shelf.cache to cache *all* objects instead of only keeping live
references. Your patch retains the cache forever instead of purging it
on sync. (All these changes only apply with writeback=True, which you
enabled by default; nothing changes with writeback=False.)
This speeds up *repeated* reads/writes as they are kept in-memory
instead of querying the-- probably slow --database every time.

I do not think this is a feasible solution for two reasons:
(1) writeback was never intended to do such thing. It was introduced as
a solution to "make shelve less surprising." If you remove its
sync-on-close characteristics, shelve is as surprising as before. See
issue553171.
(2) If you intend to implement caching on *any* database I'd suggest not
using shelve for that matter. Using it for serialization is all okay but
I'd rather add an additional layer of indirection to implement caching
strategies if you want to do that The Right Way. (Shelf.cache is really
only a map of objects that were touched during runtime.)

I'm -1 on this patch but generally +1 on a generic caching wrapper.

The error you describe later on appears because Python is already
tearing down when gc'ing the Shelf (calling __del__ -> close -> sync).
With writeback=True this currently tries to pickle the cache again which
emits the error you observed. This should be handled in a separate issue.

--
nosy: +lehmannro

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6922] Interpreter hangs up while trying to decode invalid utf32 stream.

2009-09-16 Thread Alex

New submission from Alex :

*** Prerequisites:
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
(Intel)] on win32

*** Description:
'utf_32_le' and 'utf_32_be' codecs are overconsuming memory when input
data are damaged and kwarg 'errors' to str.decode is other than 'strict'.

*** Steps:
1. Start interpreter
2. Type:
   '\x01'.decode('utf_32_le', 'replace')
or
   '\x01'.decode('utf32', 'ignore')
or
   ('something'.encode('utf32') + '\x00').decode('utf32', 'ignore')
3. Execute

*** Notes:
1. seems like any stream raising UnicodeDecodeError in 'strict' mode
causes hangup in 'ignore' or 'replace'.

*** Expected result:
1. AssertionError on "assert errors == 'strict'" raised, just as
bz2_codec does, if utf32 cannot be partially decoded at all.
2. Behaviour that 'utf8' and 'utf16' implement for such cases.

*** Received result:
1. Interpreter hangs, uses up to 100% of CPU kernel and starts to
consume RAM.
2. Grows large enough to consume all the RAM it could get (takes up to
several minutes on my machine).
3. Produces following traceback:
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python26\lib\encodings\utf_32_be.py", line 11, in decode
return codecs.utf_32_be_decode(input, errors, True)
MemoryError
4. Sometimes traceback is printed, but text "MemoryError" is not, just
leaving blank line in the place.

--
components: Interpreter Core, Library (Lib), Unicode, Windows
messages: 92704
nosy: mwizard
severity: normal
status: open
title: Interpreter hangs up while trying to decode invalid utf32 stream.
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6873] posix_lchown: possible overflow of uid, gid

2009-09-16 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Yes, it looks correct now. I still wish it could be tested on a system 
where the problem actually occurs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6921] recursion wierdness ... related to variable scoping?

2009-09-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

This is almost certainly not a bug in Python.  At a guess, in the 
outermost 'else' clause of your dump method, self.keys can be empty.  Then 
the 'for p, k in enumerate(self.keys):' does zero iterations, so p is not 
defined in the assert;  hence the error message.

If you want help figuring out exactly what's going wrong, I'd suggest 
asking on comp.lang.python.

--
nosy: +marketdickinson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6921] recursion wierdness ... related to variable scoping?

2009-09-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

Ah, I see the problem now:  you're expecting that after

for p, elt in enumerate(mylist):


p will be equal to len(mylist)-1.  That's true if mylist is nonempty 
(because on the last round of the for loop, p gets the value len(mylist)-
1), but if mylist is empty then no assignment to p or to elt is ever made.  
That's just the way that Python for loops work, I'm afraid.  :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

The patch leads to crashes with all the exceptions that have their own
structs; since they are derived from BaseException they must start with
the same binary layout as PyBaseExceptionObject (pointers to any
exception will be cast to PyBaseExceptionObject).

This also shows one way in which this change can mess up third-party
extensions (though I don't know if anybody does that): if some extension
created new exception classes doing it the way we do, e.g. for SyntaxError.

However, I have a different suggestion: we could put a user-set
"message" in the __dict__.  The getter would then check for that first
and only warn if it falls back to self->message. See attached patch.

--
Added file: http://bugs.python.org/file14901/exception-message-fix-2.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Huh. I just made some tests to find out if exceptions with a message set
survive pickling in 2.6.2 and unpickling in patched trunk.

I found that the message attribute isn't pickled at all in 2.6.2, so
there should be no cross-version compatibility problems with pickles.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-16 Thread Alan Isaac

Alan Isaac  added the comment:

I hope it is not too annoying to link these ...

I asked thhis of Jean-Paul but now I'll ask it of George.
Since you are working on this, can you see if 
http://bugs.python.org/issue6108 
is related or in any case can be fixed at the same time?

Thanks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6713] Integer & Long types: Performance improvement of 1.6x to 2x for base 10 conversions

2009-09-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

Updated patch, with minor changes:
  - remove an incorrect Py_DECREF(str)
  - rename _PyLong_ToDecimal;  no need for the _Py prefix, since this
function isn't shared across files
  - absorb special case for 0 into the rest of the code
  - whitespace and indentation fixes

Not that it matters much, but it's curious that on my machine (gcc-4.2, OS 
X 10.6.1, x64-64) it's significantly faster (~6% increase in str() speed 
for large integers) to use the line:

pout[j] = z - (twodigits)hi * _PyLong_DECIMAL_BASE;

in the middle of the inner loop, rather than the line:

pout[j] = z - hi * _PyLong_DECIMAL_BASE;

I'm wondering whether this is just a quirk of my OS/compiler combination, 
or whether there's a good reason for this difference.  The lines are 
functionally equivalent, since the result is reduced modulo 2**32 either 
way, but the first line involves a 32x32->64 multiplication and a 64-bit 
subtraction, where the second involves a 32x32->32 multiplication and a 
32-bit subtraction;  the generated assembly code for the second line is 
also one instruction shorter (there's a move opcode saved somewhere).

--
Added file: 
http://bugs.python.org/file14902/long_decimal_conversion_py3k_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

Yes, it should be fixed, but it is not related.  I'm setting it as a
release blocker as well.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6108] unicode(exception) behaves differently on Py2.6 when len(exception.args) > 1

2009-09-16 Thread Georg Brandl

Changes by Georg Brandl :


--
priority: high -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6890] IOError has no __unicode__ method - and loses information

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

And this is a duplicate of (the somewhat complicated-named) #6108.

--
nosy: +georg.brandl
resolution:  -> duplicate
status: open -> closed
superseder:  -> unicode(exception) behaves differently on Py2.6 when 
len(exception.args) > 1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-16 Thread Brett Cannon

Brett Cannon  added the comment:

Just looked at the patch and it looks good to me. I say go ahead and 
commit, Georg.

--
assignee: loewis -> georg.brandl
stage:  -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6923] Need pthread_atfork-like functionality in CPython

2009-09-16 Thread Thomas Wouters

New submission from Thomas Wouters :

In order to properly handle multiple threads and fork()-calls from C code 
(rather than os.fork()), Python should provide pthread_atfork()-like 
functionality: a function to call before a fork, to acquire any locks 
that need to be acquired, and a pair of functions to call after the fork, 
in the parent and the child, to release or re-allocate locks. The 
acquisitions should be re-entrant and should not require an existing 
threadstate. Also see .

--
assignee: twouters
components: Interpreter Core
messages: 92715
nosy: twouters
priority: low
severity: normal
stage: needs patch
status: open
title: Need pthread_atfork-like functionality in CPython
type: feature request

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1590864] Function-level import in os triggering an threaded import deadlock

2009-09-16 Thread Thomas Wouters

Thomas Wouters  added the comment:

Checked in the patch to fix the forks-through-os.fork() cases, which 
should be most of them. Forks from other C code will need some more work, 
created http://bugs.python.org/issue6923 to track that.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6918] ctypes compilation error on SnowLeopard

2009-09-16 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Annoyingly PyObjC suffers from the same issue. I hadn't noticed this yet 
because I've been linked to the system copy of libffi the last couple of 
months.

Luckily Apple has already released the source code for libffi in 10.6 
(see http://www.opensource.apple.com/source/libffi/libffi-15/, or 
http://www.opensource.apple.com/tarballs/libffi/libffi-15.tar.gz). 

Next steps:
* Check diffs between this release and the one in ctypes
* Update ctypes libffi_osx based on those differences
* Test the result on 10.5 and 10.6

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-16 Thread Georg Brandl

Georg Brandl  added the comment:

OK, I added another test for pickling, committed in r74845, and
backported to 2.6 in r74848.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-16 Thread Kevin Walzer

Kevin Walzer  added the comment:

The bug with the edit menu sounds like the same issues I noted in 
http://bugs.python.org/issue6463. I think it was related to something in 
Tk-Cocoa 8.5, which was resolved in a later build of Tk, and which is why 
I closed the bug. The build of Tk-Cocoa that ships with Snow Leopard may 
have preceded the bug fix (there has been a lot of activity on the Tk-
Cocoa front in recent weeks). If that's the case, I doubt a fix will be 
available unless Apple updates its core Tk libraries. The best workaround 
might be to install an updated build from the source 
http://github.com/das/tcltk/tree/de-carbon-8-5 into /Library/Frameworks.

--
nosy: +wordtech

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6508] expose setresuid

2009-09-16 Thread Travis H.

Travis H.  added the comment:

I have coded up a first draft at implemented {get,set}res{gid,uid}
functions.  This completes the exposure of the user and group setting
functions, and enables python programmers to be able to safely drop
privileges, for example when running network daemons as root that need
to drop down to user privileges, or writing a setuid program which needs
to do the same.

I cannot test this in my current environment because I'm stuck with Red
Hat and it does not have a recent enough automake to re-create configure
from configure.in.

--
versions: +Python 2.6 -Python 3.2
Added file: http://bugs.python.org/file14903/foo.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6851] urllib.urlopen crashes in a thread on Snow Leopard

2009-09-16 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

The attached patch seems to fix the issue, but needs further testing. 

Warning: the patch is not entirely clean, the patch contains an 
unrelated change to setup.py.

The patch replaces some code that uses ctypes to read configuration data 
using the SystemConfiguration framework by a regular extension. 

With this patch the crasher goes away, I still have to do more testing 
and proper checking of the C code.

The patch is for the trunk, I expect it will cleanly port to 2.6. It 
will also need porting to 3.x later on.

--
keywords: +26backport, patch
Added file: http://bugs.python.org/file14904/urllib-crash.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-16 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

kevin: do you know if there is a plain Tcl script that shows the bug? If 
there is we can file a bugreport with Apple that clearly shows a problem 
in the Tk framework and hence makes it more likely that the issue will get 
fixed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-16 Thread Kevin Walzer

Kevin Walzer  added the comment:

Ronald: No, unfortunately I was never able to reproduce the bug in pure 
Tcl. I tried various examples with the Tk text widget. I also tried 
various examples with the text widget via Tkinter. Each time the text 
widget, cutting, pasting, etc. worked as expected. I suspect the bug is 
somewhere in IDLE's interaction with that iteration Tk-Cocoa, but I could 
not pinpoint it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6924] struct.unpack weird behavior with "bi" (byte then integer)

2009-09-16 Thread Emmanuel Bengio

New submission from Emmanuel Bengio :

Using the following command in Python 2.6.1:

>>> struct.unpack("BI","12345")
Traceback (most recent call last):
  File "", line 1, in 
struct.unpack("BI","12345")
error: unpack requires a string argument of length 8

I get this error message. What confused me was that doing
>>> struct.unpack("IB","12345")
(875770417, 53)
Worked just fine.

I have found out that this only happens using the native byte
order("@"), which is the default.
For Example:
>>> struct.unpack("!BI","12345")
(49, 842216501)
Works, and all other variants, =, <, > (native standard,little endian,
and small endian) also do.

I haven't found anything about that in the documentation.

Also, the requested 3 other bytes arent event used:
>>> struct.unpack("I","abcd")
(1684234849,) # see the big number starting with 16
>>> ord("x")
120
>>> struct.unpack("BI","xabcd") # we get the error
Traceback (most recent call last):
  File "", line 1, in 
struct.unpack("BI","xabcd")
error: unpack requires a string argument of length 8
>>> struct.unpack("BI","xabcdefg")
(120, 1734763876) # not the same here
>>> struct.unpack("BI","xabcabcd")
(120, 1684234849) # same here
>>> struct.unpack("BI","x___abcd")
(120, 1684234849) # same again

--
components: Library (Lib)
messages: 92724
nosy: Manux
severity: normal
status: open
title: struct.unpack weird behavior with "bi" (byte then integer)
type: behavior
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6924] struct.unpack weird behavior with "bi" (byte then integer)

2009-09-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

I think this is expected behaviour:  the key point is that structs can 
include padding bytes.  From the documentation:

"By default, C numbers are represented in the machine’s native format and 
byte order, and properly aligned by skipping pad bytes if necessary 
(according to the rules used by the C compiler)."

'Native' struct formats include padding, while 'standard' formats don't.

So a native struct with format 'BI' has one byte for the 'B', followed by 
3 padding bytes, followed by four bytes for the 'I'.  This exactly matches 
the way a C struct of the form {char c; int x;} would be organized in 
memory on that machine.

--
assignee:  -> marketdickinson
nosy: +marketdickinson
resolution:  -> works for me
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6508] expose setresuid

2009-09-16 Thread Dave Malcolm

Dave Malcolm  added the comment:

> I cannot test this in my current environment because I'm stuck with Red
> Hat and it does not have a recent enough automake to re-create configure
> from configure.in.

FWIW, it may be an _autoconf_ version issue; I'm able to recreate a
"configure" from Python's "configure.in" on my RHEL5 box by downloading
autoconf-2.61 from http://ftp.gnu.org/gnu/autoconf/
installing it to /usr/local (with ./configure ; make; sudo make install)
then invoking /usr/local/bin/autoconf in the root of an SVN checkout of
python.   Hope this is helpful.

--
nosy: +dmalcolm

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6713] Integer & Long types: Performance improvement of 1.6x to 2x for base 10 conversions

2009-09-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

Applied long_decimal_conversion_py3k_2.patch in r74851;  backported to 
trunk in r74853.

Still to do:
 - look at the 'two-digits-at-a-time' optimization.
 - rip out the non-binary-base code from _PyLong_Format

While we're at it, it would also be good to look at the decimal string -> 
integer conversion,  but I think that's a separate issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6921] recursion wierdness ... related to variable scoping?

2009-09-16 Thread David Hanney

David Hanney  added the comment:

Ooops. I'm just learning Python and it never occurred to me that I could
get through the for without k begin defined. At least not until about an
hour ago in the cinema. I came here ASAP but you'd already got to it.
Sorry for wasting your time.

I should have spent more time boiling down a concise test case then I
could have seen this for myself BEFORE posting. Once again, apologies.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6926] socket module missing IPPROTO_IPV6, IPPROTO_IPV4

2009-09-16 Thread Jason R. Coombs

New submission from Jason R. Coombs :

It appears that somewhere between Python 2.5 and Python 2.6, some socket
constants were lost in Windows builds.

Python 2.6.2 (r262:71605, Apr 14 2009, 22:46:50) [MSC v.1500 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket; socket.IPPROTO_IPV6
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute 'IPPROTO_IPV6'

Confirmed this problem on 32-bit builds and Python 3.1.1 also. I suspect
the compiler upgrade influenced this behavior.

Let me know if I can help track down the issue.

--
components: IO, Windows
messages: 92730
nosy: jaraco
severity: normal
status: open
title: socket module missing IPPROTO_IPV6, IPPROTO_IPV4
type: behavior
versions: Python 2.6, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6925] Doc for locals and vars

2009-09-16 Thread Terry J. Reedy

New submission from Terry J. Reedy :

Doc for locals(): after correctly stating
"Update and return a dictionary representing the current local symbol table.

Note
The contents of this dictionary should not be modified; changes may not
affect the values of local variables used by the interpreter."

current doc goes on to say
"Free variables are returned by locals() when it is called in a function
block. Modifications of free variables may not affect the values used by
the interpreter. Free variables are not returned in class blocks."

As best I can understand this, it is wrong and should be removed. Free
variables within a function block are global/nonlocal names and by my
experimentation with 3.1, (including lambda expressions) are NOT
returned by locals(). If it means something else, it needs a rewrite.

The doc for var() starts "Without arguments, return a dictionary
corresponding to the current local symbol table." I suggest augmenting
this with 'update and ' (to match locals doc) and '(same as locals())'
to make that fact clear (as it is with help(vars)), even though removing
the 'Free variables' stuff will help the latter clearer also. The result
would be

Without arguments, update and return a dictionary corresponding to the
current local symbol table (same as locals()).

--
messages: 92728
nosy: tjreedy
severity: normal
status: open
title: Doc for locals and vars
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6926] socket module missing IPPROTO_IPV6, IPPROTO_IPV4

2009-09-16 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

This comment from the MSDN docs may be relevant:

On the Microsoft Windows Software Development Kit (SDK) released for
Windows Vista and later, the organization of header files has changed
and IPPROTO_IPV6 level is defined in the Ws2def.h header file which is
automatically included in the Winsock2.h header file. The IPPROTO_IPV6
socket options are defined in the Ws2ipdef.h header file which is
automatically included in the Ws2tcpip.h header file. The Ws2def.h and
Ws2ipdef.h header files should never be used directly.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1294232] Error in metaclass search order

2009-09-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee:  -> georg.brandl
nosy: +georg.brandl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6927] Metaclass doc (Ref 3.3.3) errors

2009-09-16 Thread Terry J. Reedy

New submission from Terry J. Reedy :

3.3.3. Customizing class creation
3.1/3.2 docs say
"If the metaclass keyword argument is based with the bases, it is used."
(new version for 3.x) I presume 'based' was meant to be 'passed'.

However, with that correction, would it really be correct?
I presume the metaclass compatibility issue discussed in #1294232 for
2.x is still relevant for 3.x.

The next line
"Otherwise, if there is at least one base class, its metaclass is used."
(same as for 2.x docs) does not say which 'its' is used if there is more
than one. See paragraph above and #1294232.

I do not know the actual rule well enough to improve the neglected
suggestion in the referenced issue.

--
assignee: georg.brandl
components: Documentation
messages: 92732
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: Metaclass doc (Ref 3.3.3) errors
versions: Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6928] Doc: Class statements and metaclass = xxx

2009-09-16 Thread Terry J. Reedy

New submission from Terry J. Reedy :

For 3.x, I think 7.7 Class Definitions should mention the metaclass
keyword arg and cross-reference 3.3.3 Customizing class creation. Since
it is no longer a 'special' name, let alone a 'special method name',
there is no reason to know to look for it under that heading (I didn't
until I looked for 'metaclass' in the index, which I had to know to look
for, of course).

A possible sentence after "The class name is bound to this class object
in the original local namespace." (and before discussion of @classdeco)

"To modify this process, add 'metaclass = xxx' to the list of bases and
see CCustomizing class creation." with the last three words being a blue
link to 3.3.3.

2.x would need something a bit different, or just less ;-)

--
assignee: georg.brandl
components: Documentation
messages: 92733
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: Doc:  Class statements and metaclass = xxx
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6905] inspect.getargspec(print) fails

2009-09-16 Thread Yuv Gre

Yuv Gre  added the comment:

You're right, I was confused by the statement "arg is not a Python 
function". I didn't realize 'arg' meant the function I passed to 
getargspec, I thought it was just strange.

After digging a bit into inspect.py, may I suggest line 814 be changed 
from:
raise TypeError('arg is not a Python function')

to:
raise TypeError('%s is not a Python function' % func)

That way the error I would have received would have given:
TypeError:  is not a Python function

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6926] socket module missing IPPROTO_IPV6, IPPROTO_IPV4

2009-09-16 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I think I found the problem.

It appears Python is compiled with 

#define _WIN32_WINNT 0x0500

But IPPROTO_IPV6 (and other constants) are only defined

#if(_WIN32_WINNT >= 0x0501)

What's the proper fix for this issue?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6926] socket module missing IPPROTO_IPV6, IPPROTO_IPV4

2009-09-16 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I think a suitable test case for this issue is:

if hasattr(sys, 'getwindowsversion'):
  if sys.getwindowsversion() >= (5,1):
assert hasattr(socket, 'IPPROTO_IPV6')

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6300] encode and decode should accept 'errors' as a keyword argument

2009-09-16 Thread Jeff Bradberry

Jeff Bradberry  added the comment:

This patch adds the requested behavior to the current 2.7 svn trunk. 
Both 'encoding' and 'errors' may be used as keyword arguments for
encode() and decode().

--
keywords: +patch
nosy: +jbradberry
Added file: http://bugs.python.org/file14905/python27.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6300] encode and decode should accept 'errors' as a keyword argument

2009-09-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

They should also probably be added to unicode(), str(), unicode.decode,
and unicode.encode then. (Also some tests, please!)

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6919] Link CRT Statically

2009-09-16 Thread Henri Hein

Henri Hein  added the comment:

If you do not *want* to change it, that is your prerogative, but it 
*can* definitely work.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

2009-09-16 Thread Zhigang Wang

Zhigang Wang  added the comment:

Thanks Robert for pointing out issue553171. 

After read that issue, I still think we paid too much to make shelf less
surprising.

We should at lease provide a option for the *smart* programmers to get
better speed and less exceptions.

The write-back-all-cache-on-close feature is easy to document, but hard
to accept when you have cached too much data.

CCing Alex and Martin for comments.

--
nosy: +aleax, loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6300] encode and decode should accept 'errors' as a keyword argument

2009-09-16 Thread Jeff Bradberry

Jeff Bradberry  added the comment:

As it turns out, someone had previously made this adjustment to str()
and unicode().  My updated patch adds this behavior to unicode.decode
and unicode.encode, adds a couple of tests to test_unicode.py, and
updates the documentation to show that these functions (and str.format,
which had failed to be noted as taking them) now take keyword arguments.

--
Added file: http://bugs.python.org/file14906/python27.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com