[issue4676] python3 closes + home keys

2009-01-29 Thread Weeble

Weeble  added the comment:

Well, the status quo depends on an unsupported field - "anchor". As far
as I can tell, the only other option that allows any customisation of
cursor behaviour is to re-implement the entire selection system from the
ground up. Would it be acceptable to detect the Tk version and change
strategy accordingly?

I don't know how far back this would work: I've tested it with Tk 8.5
and 8.4.

I'll ask on comp.lang.tcl and see what they recommend fpr customising
the behaviour of a text widget.

Thanks for looking over this.

___
Python tracker 

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



[issue5056] PyAPI assumes OS can access shared data in loadable modules (windows can't)

2009-01-29 Thread Ulrich Eckhardt

Changes by Ulrich Eckhardt :


--
nosy: +eckhardt

___
Python tracker 

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



[issue4676] python3 closes + home keys

2009-01-29 Thread Weeble

Weeble  added the comment:

I posted a question on comp.lang.tcl here:

http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/aab17806f6fa837f#

By the way, which versions of Tk must Python support? Where do I find
out things like that?

___
Python tracker 

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



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'm not going to get more time to work on this before
the weekend, so if anyone else wants to take over please
feel free.

Still to do for stage 2:  cell objects and slot
wrapper objects need to have tp_richcompare
implemented, to replace the tp_compare slots that
are being removed.

___
Python tracker 

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



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

For 3.0, are you going to keep tp_compare slot in existence and just
assert that it is NULL?  Then in 3.1, remove the slot entirely?

___
Python tracker 

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



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

If I understand Christian's plan correctly, it was to:

(1) raise TypeError for non-NULL tp_compare, and
(2) rename tp_compare to tp_reserved (with type void *).

and both of these would happen with 3.0.1, so no difference between
3.0.1 and 3.1.0.

It seems to me that if tp_compare is actually going to be removed then
that should be done in 3.0.1;  else third-party stuff that works with
3.0.x will fail with 3.1, due to the various tp_* fields being out of sync.

It would be nice not to have tp_reserved hanging around for the duration
of 3.x.  (Similarly for nb_reserved.)

___
Python tracker 

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



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Instead of tp_reserved, the name should be tp_deprecated_compare.

There should be a python-dev discussion around when to actually remove
the slot:

  3.0.1 -- binary incompatibility between minor releases (BAD)
  3.1.0 -- uncomfortable for writers who have to add #ifdefs
  4.0.0 -- no pain, just wasted space
  3.1.5 -- just plain mean :-)

___
Python tracker 

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



[issue5090] import tkinter library Visual C++ Concepts:C Run-Time Error R6034 when embeded python in c++

2009-01-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Yes, issue4566 describes exactly the same problem.

--
resolution:  -> duplicate
status: open -> pending
superseder:  -> 2.6.1 breaks many applications that embed Python on Windows

___
Python tracker 

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



[issue5092] weird memory usage in multiprocessing module

2009-01-29 Thread Jerzy

Jerzy  added the comment:

I still do not understand what is going on when python executed thic 
code. I have a local variable l in my parent process. When I create a 
child process, program makes first makes a copy of memory. Than what?

I am sure that l still exists in child process because
1. It can be printed
2. It has still a lot of memory allocated for it

You say that l does not exist as a local variable in child process. Is 
it global? How can I dealocate it in child process?

Jerzy

Martin v. Löwis pisze:
> Martin v. Löwis  added the comment:
> 
> As David says, this is not a bug. del l indicates that there is a local
> variable to be deleled, but when the del statement is executed, there is
> no local variable. The error message is confusing in this case: there
> actually is no later assignment to l (in the function at all).
> Typically, when you have an unbound local, it is because of a later
> assignment, such as
> 
> def foo():
>   a = l + 1
>   l = 2
> 
> In this specific example, there is no later assignment - yet it is still
> an unbound local.
> 
> So that you get the exception is not a bug.
> 
> I was going to suggest that the error message could be better, but I
> can't think of any other error message that is better and still correct,
> hence closing it as won't fix.
> 
> --
> nosy: +loewis
> resolution:  -> wont fix
> status: open -> closed
> 
> ___
> Python tracker 
> 
> ___
> 
> 
>

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-01-29 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue4821] Patches for thread-support in built-in SHA modules

2009-01-29 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue4818] Patch for thread-support in md5module.c

2009-01-29 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue4701] range objects becomes hashable after attribute access

2009-01-29 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue5096] strange thing after call PyObject_CallMethod

2009-01-29 Thread Kandalintsev Alexandre

New submission from Kandalintsev Alexandre :

When unhandled in python code exception occurs in PyObject_CallMethod 
frame_dealloc() (Objects/frameobject.c:422) 
not called. Even if I call PyErr_Print(). 

But if I call PyErr_Clear() then all okay. Documentation says that both 
this functions doing same work(http://docs.python.org/3.0/c-api/
exceptions.html). As we see thats not true or not all nuances documented.

Examples and more on this mailing list:
http://groups.google.com/group/comp.lang.python/browse_thread/
thread/19316b3effa37d2d

--
components: Interpreter Core
messages: 80757
nosy: exe
severity: normal
status: open
title: strange thing after call PyObject_CallMethod
type: behavior
versions: Python 3.0, Python 3.1

___
Python tracker 

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



[issue4676] python3 closes + home keys

2009-01-29 Thread Guilherme Polo

Guilherme Polo  added the comment:

> Weeble  added the comment:
>
> Well, the status quo depends on an unsupported field - "anchor".

Better not repeat the mistake then ?

> As far
> as I can tell, the only other option that allows any customisation of
> cursor behaviour is to re-implement the entire selection system from the
> ground up. Would it be acceptable to detect the Tk version and change
> strategy accordingly?
>

IDLE already reimplements several things, which were useful back then
when it wasn't reimplementing -- just adding functionality. If the
only correct solution is really to reimplement the selection, then it
would be better to do it anyway, but I don't think it is.

I'm interested in knowing how many interactive shells implement this
same behaviour, or if there are that many I would like at least some
examples. I'm unsure about the usefulness of the current functionality
(supposing it was working as intended).

> I don't know how far back this would work: I've tested it with Tk 8.5
> and 8.4.
>

All versions of 8.4 ? I've seen complaints about early releases of tk
8.4 and the use of the unsupported function.

___
Python tracker 

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



[issue5096] strange thing after call PyObject_CallMethod

2009-01-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I think I have an explanation:
When a python exception is raised, the current call stack is stored in
the exception state (tstate->curexc_traceback). This includes all the
living frame objects, with all their local variables.
This explains why frame_dealloc is not called at this time, and why the
"self" object has its refcount increased.

PyErr_Clear() releases everything.
PyErr_Print() does clear tstate->curexc_traceback, but only to copy the
value into sys.last_traceback; So the frame object is still alive.

I suggest you to use PyErr_PrintEx(0), which will print and clear the
error, but not store the exception info into the sys.last_* variables.
[PyErr_Print() simply calls PyErr_PrintEx(1); No, it's not yet documented]

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue5075] bdist_wininst should not depend on the vc runtime?

2009-01-29 Thread Mark Hammond

Mark Hammond  added the comment:

Checked into trunk as r69094; merged to release26-maint as r69095, py3k
as r69096 and release30-maint as r69097.

--
resolution: accepted -> 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



[issue5096] strange thing after call PyObject_CallMethod

2009-01-29 Thread Kandalintsev Alexandre

Kandalintsev Alexandre  added the comment:

Thank you for your activity. This feature drank alot of my blood. Please 
document this or change behavior.

PS Older python versions may be also affected so changing behavior may 
brake existing code :(

___
Python tracker 

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



[issue4174] Performance optimization for min() and max() over lists

2009-01-29 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue5076] bdist_wininst fails on py3k

2009-01-29 Thread Mark Hammond

Mark Hammond  added the comment:

Checked into py3k as r6998; merged to release30-maint as 69099.  I hope
I got that right!

--
resolution: accepted -> 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



[issue5096] strange thing after call PyObject_CallMethod

2009-01-29 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
assignee:  -> georg.brandl
components: +Documentation -Interpreter Core
nosy: +georg.brandl

___
Python tracker 

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



[issue5097] asyncore.dispatcher_with_send undocumented

2009-01-29 Thread Kandalintsev Alexandre

New submission from Kandalintsev Alexandre :

Hello!

asyncore.dispatcher_with_send undocumented in all python versions

--
assignee: georg.brandl
components: Documentation
messages: 80763
nosy: exe, georg.brandl
severity: normal
status: open
title: asyncore.dispatcher_with_send undocumented

___
Python tracker 

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



[issue4676] python3 closes + home keys

2009-01-29 Thread Weeble

Weeble  added the comment:

You're right: we should find a solution that's safe and supported.

I *think* the primary reason for overriding the home key behaviour was 
not for the interactive shell, but to make it easier to edit code. Most 
programmer's editors that do automatic indentation also let you use home 
to move to the beginning of the text on a line, rather than the absolute 
beginning of the line. I couldn't say for sure though: I'm new here.

I've proposed some changes to the ctrl-left, ctrl-right behaviour on 
idle-dev that would also require custom handling of selection behaviour. 
If it were to be decided that reimplementing the selection-handling was 
worthwhile I would be willing to work on such a patch to redo the 
selection-handling using only supported Tk features, but I get the 
impression I'd need lots of help to get it tested with every possible 
version of Tcl/Tk.

___
Python tracker 

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



[issue5098] Environ doesn't escape spaces properly

2009-01-29 Thread Stuart Axon

New submission from Stuart Axon :

os.environ doesn't escape spaces, but does backslashes and others

In the windows python interpreter I echo'd the variable 'ProgramFiles',
then in the commandprompt.

>>> from os import environ
>>> environ['ProgramFiles']
'C:\\Program Files'
>>> ^Z

[C:\]echo %ProgramFiles%
C:\Program Files

This 'half' escapping seems odd, and is annoying when building file
paths for instance, probably the space should also be escaped.

--
components: None
messages: 80765
nosy: stuaxo
severity: normal
status: open
title: Environ doesn't escape spaces properly
type: behavior
versions: Python 2.5

___
Python tracker 

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



[issue4676] python3 closes + home keys

2009-01-29 Thread Guilherme Polo

Guilherme Polo  added the comment:

> Weeble added the comment:
>
> I *think* the primary reason for overriding the home key behaviour was
> not for the interactive shell, but to make it easier to edit code. Most
> programmer's editors that do automatic indentation also let you use home
> to move to the beginning of the text on a line, rather than the absolute
> beginning of the line.
>

Yes, but IDLE goes beyond that and adds some weird behaviour.
Suppose you have this line in IDLE:

>>> 

Why would you want to go at the absolute beginning there ? That is
what happens when you press home twice.
Then there is the other case, the reason for the current home code:

   y, ...

Pressing home twice while on the second line toggles between the
absolute start of that line and one position before y, this is the
behaviour that I haven't seen used anywhere else (but it is not like I
have used many GUI shells). If it is used everywhere else I haven't
looked at then this might be good because people are accustomed to,
otherwise it is just a feature that IDLE has for no reason.

> I've proposed some changes to the ctrl-left, ctrl-right behaviour on
> idle-dev that would also require custom handling of selection behaviour.

I'm subscribed to idle-dev but I assume I don't read it at all.

> If it were to be decided that reimplementing the selection-handling was
> worthwhile I would be willing to work on such a patch to redo the
> selection-handling using only supported Tk features, but I get the
> impression I'd need lots of help to get it tested with every possible
> version of Tcl/Tk.
>

Before start writing new code I suggest to check how many IDLE forks
exist, and check if any of them has this fixed. It would be good to
start writing tests for idlelib too.
Testing with every possible version of Tcl/Tk is not going to work,
the minimal possible is 8.2 as it is what _tkinter supports. But I
suspect most people are using tk 8.4 (and then there are a lot of
minor releases), some tk 8.5 and very few using other versions.
The externally maintained tk versions are 8.4.12, 8.4.16, 8.4.18.1 and
8.5.2.0 so we could target these versions.

___
Python tracker 

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



[issue3823] ssl.wrap_socket() is incompatible with servers that drop privileges, due to keyfile requirement

2009-01-29 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue5098] Environ doesn't escape spaces properly

2009-01-29 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

The backslash escaping has nothing to do with os.environ.  It's the way
any string with a backslash in it is displayed in the interactive
interpreter (it's the way str.__repr__ works).  Performing any escaping
on a string to make it usable in a command line is a task which is
inappropriate as a feature of os.environ.  The contents of os.environ
are just strings.  If you want to use them in a command line, you need
to escape them appropriately.  Notice that in addition to escaping the
space, you may also sometimes need to escape a backslash (not in this
case on Windows, though, since a single \ is allowed here).  The
escaping of the \ in this example is *only* in the *display* of the
variable - there is only one \ in the string itself.

I recommend closing this ticket as invalid.

--
nosy: +exarkun

___
Python tracker 

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



[issue3823] ssl.wrap_socket() is incompatible with servers that drop privileges, due to keyfile requirement

2009-01-29 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone :


--
nosy:  -exarkun

___
Python tracker 

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



[issue4676] python3 closes + home keys

2009-01-29 Thread Weeble

Weeble  added the comment:

I can't see any useful reason to go to the absolute start of the line in 
the interactive shell. However, it does make sense in the source editor, 
and it is consistent with, for example, Visual Studio. The first use-
case off the top of my head is when you want to copy a block of code and 
not lose the relative indentation of the first line. You press home-
twice to go to the absolute start of line and select from there. It's 
also the only quick way in IDLE to be sure that the text widget is 
scrolled all the way to the left, since there's no horizontal scrollbar. 
(Any idea why that is? I assumed it's to discourage long lines, but I 
don't know.)

The proposal I refer to in IDLE-dev is this:
http://mail.python.org/pipermail/idle-dev/2009-January/002742.html

I only mention it because it demonstrates another reason why we might 
want to override the default selection/navigation mechanics.

___
Python tracker 

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



[issue4676] python3 closes + home keys

2009-01-29 Thread Guilherme Polo

Guilherme Polo  added the comment:

> It's
> also the only quick way in IDLE to be sure that the text widget is
> scrolled all the way to the left, since there's no horizontal scrollbar.
> (Any idea why that is? I assumed it's to discourage long lines, but I
> don't know.)

The shell is configured to wrap lines if they get too long, but you
will notice that pressing 'end' doesn't really get you to the end of
line.
It should be easier to not wrap there too and add a horizontal
scrollbar (if needed) to all text widgets used by idle.

___
Python tracker 

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



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Actually, I would like to repurpose tp_compare as tp_bytes for the
__bytes__ method.

___
Python tracker 

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



[issue5097] asyncore.dispatcher_with_send undocumented

2009-01-29 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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

___
Python tracker 

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



[issue5099] subprocess.POpen.__del__() AttribuetError (os module == None!)

2009-01-29 Thread Mary Stern

New submission from Mary Stern :

I was getting this error (while running my unit tests):

Exception exceptions.AttributeError: "'NoneType' object has no attribute
'error'" in > ignored

which I tracked down to the os module being set to None (yes really!) in
POpen._internal_poll() when called from Popen.__del__, so this line:

except os.error:

was generating the error.

I guess that the module is getting unloaded earlier somehow (maybe a
race condition)?

--
components: Extension Modules
messages: 80771
nosy: marystern
severity: normal
status: open
title: subprocess.POpen.__del__() AttribuetError (os module == None!)
type: crash
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



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2009-01-29 Thread Raghuram Devarakonda

Raghuram Devarakonda  added the comment:

On Wed, Jan 28, 2009 at 5:13 PM, Antoine Pitrou  wrote:

shutil_destinsrc.patch has both the code chage and two test cases.
Actually test cases are much longer than the code itself :-).

___
Python tracker 

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



[issue2578] Figure out what to do with unittest's redundant APIs

2009-01-29 Thread Guilherme Polo

Guilherme Polo  added the comment:

As an side-side-note, I find much more important to add some kind of
test discovery since it is being duplicated in several packages in Lib/
and will continue being duplicated.

--
nosy: +gpolo

___
Python tracker 

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



[issue5099] subprocess.POpen.__del__() AttributeError (os module == None!)

2009-01-29 Thread Mary Stern

Changes by Mary Stern :


--
title: subprocess.POpen.__del__() AttribuetError (os module == None!) -> 
subprocess.POpen.__del__() AttributeError (os module == None!)

___
Python tracker 

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



[issue5099] subprocess.POpen.__del__() AttributeError (os module == None!)

2009-01-29 Thread David W. Lambert

Changes by David W. Lambert :


--
nosy: +LambertDW

___
Python tracker 

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



[issue4174] Performance optimization for min() and max() over lists

2009-01-29 Thread David W. Lambert

Changes by David W. Lambert :


___
Python tracker 

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



[issue4174] Performance optimization for min() and max() over lists

2009-01-29 Thread David W. Lambert

Changes by David W. Lambert :


___
Python tracker 

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



[issue2578] Figure out what to do with unittest's redundant APIs

2009-01-29 Thread Guido van Rossum

Guido van Rossum  added the comment:

@gpsmith: Way to go!

@gpolo: Alas, test discovery is now a much harder problem because it
depends on using conventions for test naming.  Unless all existing
implementations use the same conventions, it's hard to see how to
replace them.  Please bring that up on python-id...@python.org.

___
Python tracker 

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



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2009-01-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Sorry, I had only given a quick look at Benjamin's patch, not yours.
Actually Benjamin's patch does not seem to address anything, which makes
things more confusing.

___
Python tracker 

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



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2009-01-29 Thread Raghuram Devarakonda

Raghuram Devarakonda  added the comment:

On Thu, Jan 29, 2009 at 1:32 PM, Antoine Pitrou  wrote:
> Sorry, I had only given a quick look at Benjamin's patch, not yours.
> Actually Benjamin's patch does not seem to address anything, which makes
> things more confusing.

True. It is all a bit unfortunate for such a small change to get
bogged down like this. I specifically asked about the patch proposed
by Christian and implemented by Benjamin (in msg63168) but no one
bothered to reply. Please look at my patch and see if you can apply
it. In fact, I even submitted it when Guido asked for some patches to
test codereview tool initially. It is at
http://codereview.appspot.com/841/show.

___
Python tracker 

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



[issue5092] weird memory usage in multiprocessing module

2009-01-29 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> I still do not understand what is going on when python executed thic 
> code. I have a local variable l in my parent process. 

No, you don't. It's a global variable, not a local one.

> When I create a 
> child process, program makes first makes a copy of memory. Than what?

It doesn't have to do anything with the multiprocessing at all.
For comparison, just run the Python script

def f():
  del l
l = []
f()

It produces the same error, with no multiprocessing involved.

___
Python tracker 

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



[issue5076] bdist_wininst fails on py3k

2009-01-29 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> Checked into py3k as r6998; merged to release30-maint as 69099.  I hope
> I got that right!

If you ask whether checking into py3k was the right thing: yes, it was.

___
Python tracker 

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



[issue5098] Environ doesn't escape spaces properly

2009-01-29 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

As Jean-Paul explains, you are misinterpreting what you are seeing.
Closing as invalid.

--
nosy: +loewis
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



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Brett Cannon

Brett Cannon  added the comment:

On Thu, Jan 29, 2009 at 07:30, Benjamin Peterson  wrote:
>
> Benjamin Peterson  added the comment:
>
> Actually, I would like to repurpose tp_compare as tp_bytes for the
> __bytes__ method.

Repurposing would be extremely bad as that would mean it is possible
for people to actually compile code with a busted __bytes__
implementation.

___
Python tracker 

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



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

On Thu, Jan 29, 2009 at 2:39 PM, Brett Cannon  wrote:
>
> Brett Cannon  added the comment:
>
> On Thu, Jan 29, 2009 at 07:30, Benjamin Peterson  
> wrote:
>>
>> Benjamin Peterson  added the comment:
>>
>> Actually, I would like to repurpose tp_compare as tp_bytes for the
>> __bytes__ method.
>
> Repurposing would be extremely bad as that would mean it is possible
> for people to actually compile code with a busted __bytes__
> implementation.

Wasn't there another case of an old slot being reused?

___
Python tracker 

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



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Brett Cannon

Brett Cannon  added the comment:

>> On Thu, Jan 29, 2009 at 07:30, Benjamin Peterson  
>> wrote:
>>>
>>> Benjamin Peterson  added the comment:
>>>
>>> Actually, I would like to repurpose tp_compare as tp_bytes for the
>>> __bytes__ method.
>>
>> Repurposing would be extremely bad as that would mean it is possible
>> for people to actually compile code with a busted __bytes__
>> implementation.
>
> Wasn't there another case of an old slot being reused?

Not that I can remember, but I'm sure someone will correct me if I'm wrong.

___
Python tracker 

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



[issue5100] ElementTree.iterparse and Element.tail confusion

2009-01-29 Thread Jeroen Dirks

New submission from Jeroen Dirks :

I am using cElementTree.iterparse in order to parse through a huge XML
document and filter out sections of interest.

The usage pattern is that I wait for an "end" event for a element of
interest and then if it matches a some criterium I write it out using
cElementTree.tostring().

My code had bug in it because the cElementTree.tostring methods prints
the element including its tail. The element retreived from the iterparse
iterator sometimes contains the tail by the time it emits the end event
but sometimes it does not.

In my document the tail just consisted of the newline '\n' character and
about 98% of the time it was attached to the element during its end event.

This is rather confusing behavior. 

Could ElementTree/cElementTree.iterparse be changed so that if you
respond to the end event for an element its tail is never set?

--
components: XML
messages: 80783
nosy: jeroen.dirks
severity: normal
status: open
title: ElementTree.iterparse and Element.tail confusion
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



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2009-01-29 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> accepted
versions: +Python 2.7, Python 3.0, Python 3.1 -Python 2.5

___
Python tracker 

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



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2009-01-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed, thanks!

___
Python tracker 

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



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2009-01-29 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution: accepted -> 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



[issue5101] test_funcattrs truncated during unittest conversion

2009-01-29 Thread Mark Dickinson

New submission from Mark Dickinson :

It looks as though a few of the tests in test_funcattrs disappeared in the 
conversion to unittest, committed in r60522.  (The first one I noticed was 
test_empty_cell, but there are others missing too.)

Question for Georg (who did the checkin): do you know whether these tests 
were removed deliberately?  Or should they be reintroduced if possible?

--
components: Tests
messages: 80785
nosy: georg.brandl, marketdickinson
severity: normal
status: open
title: test_funcattrs truncated during unittest conversion

___
Python tracker 

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



[issue3311] block operation on closed socket/pipe for multiprocessing

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

This issue is not critical anymore because jesse.noller fixed the 
crash in r68768.

Python 2.7a0 (trunk:68873M, Jan 23 2009, 08:46:25)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _multiprocessing
>>> obj = _multiprocessing.Connection(755)
>>> obj.close()
>>> obj.poll()
Traceback (most recent call last):
  File "", line 1, in 
IOError: handle out of range in select()

I would prefer a message "I/O operation on closed socket", but you can 
close this issue.

Note: I proposed a similar patch to improve the error message ("I/O 
operation on closed socket") for the socket module in issue #4853.

--
priority: critical -> normal

___
Python tracker 

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



[issue5102] urllib2.py timeouts do not propagate across redirects for 2.6.1 (and 3.x?)

2009-01-29 Thread Jacques Grove

New submission from Jacques Grove :

When doing a urllib2 fetch of a url that results in a redirect, the
connection to the redirect does not pass along the timeout of the
original url opener.  The result is that the redirected url fetch (which
is a new request) will get the default socket timeout, instead of the
timeout that the user requested originally.  This is obviously a bug.

So we have in urllib2.py in 2.6.1:

def http_error_302(self, req, fp, code, msg, headers):
.
return self.parent.open(new)

this should be:
return self.parent.open(new, timeout=req.timeout)

or something in that vein.


Of course, to be 100% correct, you should probably keep track of how
much time has elapsed since the original url fetch went out, and reduce
the timeout based on this, but I'm not asking for miracles :-)


Jacques

--
components: Library (Lib)
messages: 80787
nosy: jacques
severity: normal
status: open
title: urllib2.py timeouts do not propagate across redirects for 2.6.1 (and 
3.x?)
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



[issue4233] open(0, closefd=False) prints 3 warnings

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

This issue has been fixed in py3k, release30-maint and trunk. I think 
that 2.6.x doesn't need this API change, so I prefer to close this 
issue. Reopen the issue if I'm wrong.

--
status: open -> closed

___
Python tracker 

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



[issue3618] possible deadlock in IO library (Lib/io.py)

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

The test (io_deadlock.patch) pass on the io-c branch \o/

___
Python tracker 

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



[issue5103] ssl.SSLSocket timeout not working correctly when remote end is hanging

2009-01-29 Thread Jacques Grove

New submission from Jacques Grove :

In ssl.py of Python 2.6.1 we have this code in  SSLSocket.__init__():

if do_handshake_on_connect:
timeout = self.gettimeout()
try:
self.settimeout(None)
self.do_handshake()
finally:
self.settimeout(timeout)

The problem is, what happens if the remote end (server) is hanging when
do_handshake() is called?  The result is that the user-requested timeout
will be ignored, and the connection will hang until the TCP socket
timeout expires.

This is easily reproducable with this test code:


import urllib2
urllib2.urlopen("https://localhost:9000/";, timeout=2.0)


and running netcat on port 9000, i.e.:

nc -l -p 9000 localhost

If you use "http" instead of "https", the timeout works as expected
(after 2 seconds in this case).

--
components: Library (Lib)
messages: 80790
nosy: jacques
severity: normal
status: open
title: ssl.SSLSocket timeout not working correctly when remote end is hanging
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



[issue4626] compile() doesn't ignore the source encoding when a string is passed in

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

> I don't like the change of API to PyTokenizer_FromString. 
> I would prefer another function like 
PyTokenizer_IgnoreCodingCookie()

Ok, I created a new function PyTokenizer_FromUnicode(). I 
choosed "FromUnicode" because the string is encoded in unicode (as 
UTF-8, even if it's not the wchar_t* type).

> The (char *) cast in PyTokenizer_FromString is unneeded.

The cast on the decode_str() result? It was already present in the 
original code. I removed it in my new patch.

> You need to indent the "else" clause after you test for 
ignore_cookie.

Ooops, I always have problems to generate a diff because my editor 
removes trailing spaces and then I have to ignore space changes to 
create  the diff.

> I'd like to see a test that shows that byte strings still have their
cookies examined.

test_pep263 has already two tests using a "#coding:" header.

Added file: http://bugs.python.org/file12889/tokenizer_ignore_cookie-4.patch

___
Python tracker 

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



[issue4626] compile() doesn't ignore the source encoding when a string is passed in

2009-01-29 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12771/tokenizer_ignore_cookie-3.patch

___
Python tracker 

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



[issue3610] Fix gdbinit for Python 3.0

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

The patch is now outdated.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue3880] _tkinter._flatten() doesn't check PySequence_Size() error code

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

The bug is still here in py3k:

$ cat bla.py
import _tkinter, gc
_tkinter._flatten(True)
gc.collect()

$ ./python bla.py
Exception TypeError: "object of type 'bool' has no len()" in 'garbage 
collection' ignored
Fatal Python error: unexpected exception during garbage collection
Abandon (core dumped)

Can anyone apply my patch?

___
Python tracker 

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



[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-01-29 Thread Roman Zeyde

New submission from Roman Zeyde :

The following code shouldn't fail without any warning at all:

>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.bind(('localhost', 7))
>>> print(s.getsockname())
('127.0.0.1', 4464)

After looking through socketmodule.c (rev. 68450), it seems that AF_INET
case casts an "int port" into a "short addr->sin_port", and does not
checks for overflows:

case AF_INET:
{
struct sockaddr_in* addr;
char *host;
int port, result;
if (!PyTuple_Check(args)) {
PyErr_Format(
PyExc_TypeError,
"getsockaddrarg: "
"AF_INET address must be tuple, not %.500s",
Py_TYPE(args)->tp_name);
return 0;
}
if (!PyArg_ParseTuple(args, "eti:getsockaddrarg",
  "idna", &host, &port))
return 0;
addr=(struct sockaddr_in*)addr_ret;
result = setipaddr(host, (struct sockaddr *)addr,
   sizeof(*addr),  AF_INET);
PyMem_Free(host);
if (result < 0)
return 0;
addr->sin_family = AF_INET;
addr->sin_port = htons((short)port);
*len_ret = sizeof *addr;
return 1;
}

--
components: None
messages: 80794
nosy: roman.zeyde
severity: normal
status: open
title: getsockaddrarg() casts port number from int to short without any warning
versions: Python 2.7

___
Python tracker 

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



[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-01-29 Thread Roman Zeyde

Changes by Roman Zeyde :


--
components: +Extension Modules -None

___
Python tracker 

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



[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-01-29 Thread Roman Zeyde

Changes by Roman Zeyde :


--
type:  -> behavior

___
Python tracker 

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



[issue4474] PyUnicode_FromWideChar incorrect for characters outside the BMP (unix only)

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

For lemburg, updated patch:
 - Move USE_WCHAR_SURROGATE define outside PyUnicode_FromWideChar() 
(and indent the defines, sorry)
 - Add "#define SIZEOF_WCHAR_T 2" to PC/pyconfig.h

Added file: 
http://bugs.python.org/file12890/unicode_fromwidechar_surrogate-4.patch

___
Python tracker 

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



[issue4474] PyUnicode_FromWideChar incorrect for characters outside the BMP (unix only)

2009-01-29 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: 
http://bugs.python.org/file12822/unicode_fromwidechar_surrogate-3.patch

___
Python tracker 

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



[issue4487] Add utf8 alias for email charsets

2009-01-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

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



[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-01-29 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

heh yes, not a big deal but this should raise an overflow error in that 
case.

--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
priority:  -> low

___
Python tracker 

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



[issue1726687] Bug found in datetime for Epoch time = -1

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

> But negative time_t are still not allowed by the Microsoft CRT, 
> the tests fail.
> (...)
> is this a bug or a feature request?

Linux mktime() supports any timestamp from 1901..2038. Should we limit 
the timestamp to 1970 just because of Microsoft? Test tm_wday fixes a 
bug on Linux and doesn't change the behaviour on Windows. So the 
problem is just the unit test: the test should be different on Windows 
(make sure that -1 raises an error).

___
Python tracker 

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



[issue5105] sqlite3.Row class, handling duplicate column names resulting from a SQL join

2009-01-29 Thread Brandon Adams

New submission from Brandon Adams :

When using sqlite3.Row as the row_factory for a sqlite3 connection and 
performing a SQL join that returns rows from two or more tables with 
identical column names, the returned sqlite3.Row object contains 
duplicate keys.  Subsequently, when trying to access values by key, only 
the value contained in the lowest numbered index matching the key is 
returned.  Additionally, attempting to use the keys returned to create a 
new table in the database fails due to a duplicate column name error.

A better behavior would be for the sqlite3.Row object's indices to be 
prefixed with table names for cases in which a query produces results 
from two or more tables.

--
components: Library (Lib)
messages: 80798
nosy: sockonafish
severity: normal
status: open
title: sqlite3.Row class, handling duplicate column names resulting from a SQL 
join
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



[issue1726687] Bug found in datetime for Epoch time = -1

2009-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

My test included in mktime_fix_and_tests.patch has a problem: the 
timezone is constant and it's mine (GMT+1). I don't know how to write 
a generic test working on any time zone. I can't use 
datetime.fromtimestamp() because datetime.fromtimestamp() uses 
time.mktime() :-)

___
Python tracker 

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



[issue5085] distutils/test_sdist failure on windows

2009-01-29 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Just saw that issue, thanks, the bug was fixed some minutes ago.

I came up with about the same fix, see r69106

--
assignee:  -> tarek
nosy: +tarek
status: open -> closed

___
Python tracker 

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



[issue4673] Distutils should provide an uninstall command

2009-01-29 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

I will continue to discuss this in distutils-SIG:

Marc-André Lemburg proposed me to introduce the uninstall command from
mxSetup.py (from mxBase, http://www.egenix.com/products/python/mxBase/)

So I need to ask for opinions first

--
assignee:  -> tarek

___
Python tracker 

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



[issue3783] dbm.sqlite proof of concept

2009-01-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Am also working on a patch for this and would like to coordinate.  My
first draft is attached:

Added file: http://bugs.python.org/file12891/tmp_dev_shelver.py

___
Python tracker 

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



[issue3783] dbm.sqlite proof of concept

2009-01-29 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Some comments on tmp_dev_shelver.py...

Regarding SQLhash.__init__, it would be better to avoid relying on the
"sqlite_master" table by using the CREATE TABLE IF NOT EXISTS form of
table creation.

Setting the isolation_level in __init__ will have essentially no effect
on this code because there is currently no transaction management in the
code.  However, the rest of the code also has almost no effect, because
there are no commits anywhere in SQLhash.  All the data is always lost
when the connection is closed.

Regarding the XXX in SQLhash.__len__, there is no faster way using
"sqlite_master".  There is basically just one way to make COUNT(*) fast.
 Keep track of the count in the database (update it on inserts and
deletes).  Then, use that instead of using COUNT(*).

Once there is some use of transactions, it will indeed be important, in
DBhash.__setitem__, to make sure the delete and the insert are in the
same transaction.  Actually, a different approach would be better,
though.  INSERT OR REPLACE INTO will let you replace a row's value with
one statement.  It's also faster, since the row only has to be found once.

Additionally, an index on the key column will assist performance
substantially for large data sets.

--
nosy: +exarkun

___
Python tracker 

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



[issue4626] compile() doesn't ignore the source encoding when a string is passed in

2009-01-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

On Thu, Jan 29, 2009 at 5:13 PM, STINNER Victor  wrote:
> Ok, I created a new function PyTokenizer_FromUnicode(). I
> choosed "FromUnicode" because the string is encoded in unicode (as
> UTF-8, even if it's not the wchar_t* type).

How about PyTokenizer_FromUTF8() then?

>
>> The (char *) cast in PyTokenizer_FromString is unneeded.
>
> The cast on the decode_str() result? It was already present in the
> original code. I removed it in my new patch.

No, I was referring to this line:

tok->encoding = (char *)PyMem_MALLOC

___
Python tracker 

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



[issue3880] _tkinter._flatten() doesn't check PySequence_Size() error code

2009-01-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Applied in r69113.

--
nosy: +benjamin.peterson
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



[issue5087] set_daemon does not exist in Thread

2009-01-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r69114.

--
nosy: +benjamin.peterson
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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2009-01-29 Thread HiroakiKawai

HiroakiKawai  added the comment:

I want UTC tzinfo. too.

--
nosy: +kawai

___
Python tracker 

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



[issue3783] dbm.sqlite proof of concept

2009-01-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks for looking at this.  I'll do an update in the next few days.

___
Python tracker 

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



[issue5041] Memory leak in imp.find_module

2009-01-29 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Fixed in r69117(py3k).

--
keywords:  -needs review
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



[issue5106] Update Naming & Binding statement for 3.0

2009-01-29 Thread Terry J. Reedy

New submission from Terry J. Reedy :

Language / Execution Model / Naming & Binding 
just before example that does not work, 

class A:
a = 42
b = list(a + i for i in range(10))

says :
"The scope of names defined in a class block is limited to the class
block; it does not extend to the code blocks of methods – this includes
generator expressions since they are implemented using a function scope."

As pointed out by Alan Isaacs (clp), in 3.0,
"this includes comprehensions and generator expressions"
would be more complete and not possibly imply that g.e.s are special in
this regard.  In 2.x, 
c = [a + i for i in range(10)]
works but it fails with same 
"NameError: global name 'a' is not defined"
in 3.0.  In fact, I think 'comprehensions and ' should be added just
because this is a change which people could trip over.

--
assignee: georg.brandl
components: Documentation
messages: 80810
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: Update Naming & Binding statement for 3.0
versions: Python 3.0, Python 3.1

___
Python tracker 

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



[issue5107] built-in open(..., encoding=vague_default)

2009-01-29 Thread John Machin

New submission from John Machin :

Docs say """The default encoding is platform dependent""" but don't say
how to find out what that is, or how it is determined. On my Windows XP
SP3 setup, the default is cp1252, but the best/only guess at finding out
without actually opening a file involved sys.defaultencoding() which
produces 'utf-8'. I was pointed at locale.getpreferredencoding(), which
returns 'cp1252' on my machine.

Please add a sentence along these lines: The default encoding is
(obtained by calling|the same as) locale.getpreferredencoding(), not
sys.getdefaultencoding() -- corrected/amplified as necessary.

--
assignee: georg.brandl
components: Documentation
messages: 80811
nosy: georg.brandl, sjmachin
severity: normal
status: open
title: built-in open(..., encoding=vague_default)
versions: Python 3.0, Python 3.1

___
Python tracker 

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