[ python-Bugs-1635353 ] expanduser tests in test_posixpath fail if $HOME ends in a /

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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
>Status: Closed
>Resolution: Duplicate
Priority: 5
Private: No
Submitted By: Marien Zwart (marienz)
Assigned to: Nobody/Anonymous (nobody)
Summary: expanduser tests in test_posixpath fail if $HOME ends in a /

Initial Comment:
test_expanduser in test_posixpath checks if expanduser('~/') equals 
expanduser('~') + '/'. expanduser checks if the home dir location ends in a / 
and skips the first character of the appended path if it does (so 
expanduser('~/foo') with HOME=/spork/ becomes /spork/foo, not /spork//foo). 
This means that if you run test_posixpath with HOME=/spork/ expanduser('~') and 
expanduser('~/') both return '/spork/' and the test fails because '/spork//' != 
'/spork/'.

Possible fixes I can think of: either have expanduser strip the trailing slash 
from the home directory instead of skipping the first slash from the appended 
path (so still with HOME=/spork/ expanduser('~') would be '/spork'), or have 
the test check if expanduser('~') ends in a backslash and check if 
expanduser('~') is equal to expanduser('~/') in that case.

--

>Comment By: Marien Zwart (marienz)
Date: 2007-01-19 13:51

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

I was testing 2.5, looks like it's already fixed in svn (rev 52067). This
is a duplicate of 1566602. Sorry for wasting your time.

--

Comment By: Neal Norwitz (nnorwitz)
Date: 2007-01-19 07:00

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

What version of Python and what platform (Windows? Unix? etc)?

I tried this on Linux with Python 2.5 and test_posixpath passed.

[EMAIL PROTECTED] ~/build/python/svn/r25 $ HOME=~/ ./python -tt
./Lib/test/regrtest.py test_posixpath
test_posixpath
1 test OK.

[EMAIL PROTECTED] ~/build/python/svn/r25 $ HOME=/home/neal ./python -tt
./Lib/test/regrtest.py test_posixpath
test_posixpath
1 test OK.


--

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



[ python-Bugs-1599254 ] mailbox: other programs' messages can vanish without trace

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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 9
Private: No
Submitted By: David Watson (baikie)
Assigned to: A.M. Kuchling (akuchling)
Summary: mailbox: other programs' messages can vanish without trace

Initial Comment:
The mailbox classes based on _singlefileMailbox (mbox, MMDF, Babyl) implement 
the flush() method by writing the new mailbox contents into a temporary file 
which is then renamed over the original. Unfortunately, if another program 
tries to deliver messages while mailbox.py is working, and uses only fcntl() 
locking, it will have the old file open and be blocked waiting for the lock to 
become available. Once mailbox.py has replaced the old file and closed it, 
making the lock available, the other program will write its messages into the 
now-deleted "old" file, consigning them to oblivion.

I've caused Postfix on Linux to lose mail this way (although I did have to turn 
off its use of dot-locking to do so).

A possible fix is attached.  Instead of new_file being renamed, its contents 
are copied back to the original file.  If file.truncate() is available, the 
mailbox is then truncated to size.  Otherwise, if truncation is required, it's 
truncated to zero length beforehand by reopening self._path with mode wb+.  In 
the latter case, there's a check to see if the mailbox was replaced while we 
weren't looking, but there's still a race condition.  Any alternative ideas?

Incidentally, this fixes a problem whereby Postfix wouldn't deliver to the 
replacement file as it had the execute bit set.


--

>Comment By: A.M. Kuchling (akuchling)
Date: 2007-01-19 10:24

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

After reflection, I don't think the potential changing actually makes
things any worse.  _generate() always starts numbering keys with 1, so if a
message's key changes because of lock()'s, re-reading, that means someone
else has already modified the mailbox.  Without the ToC clearing, you're
already fated to have a corrupted mailbox because the new mailbox will be
written using outdated file offsets.  With the ToC clearing, you delete the
wrong message.  Neither outcome is good, but data is lost either way.  

The new behaviour is maybe a little bit better in that you're losing a
single message but still generating a well-formed mailbox, and not a
randomly jumbled mailbox.

I suggest applying the patch to clear self._toc, and noting in the
documentation that keys might possibly change after doing a lock().


--

Comment By: David Watson (baikie)
Date: 2007-01-18 13:15

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

This version passes the new tests (it fixes the length checking bug,
and no longer clears self._toc), but goes back to failing
test_concurrent_add.

File Added: mailbox-unified2-module.diff

--

Comment By: David Watson (baikie)
Date: 2007-01-18 13:14

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

Unfortunately, there is a problem with clearing _toc: it's basically
the one I alluded to in my comment of 2006-12-16.  Back then I thought
it could be caught by the test you issue the warning for, but the
application may instead do its second remove() *after* the lock() (so
that self._pending is not set at lock() time), using the key carried
over from before it called unlock().  As before, this would result in
the wrong message being deleted.

I've added a test case for this (diff attached), and a bug I found in
the process whereby flush() wasn't updating the length, which could
cause subsequent flushes to fail (I've got a fix for this).  These
seem to have turned up a third bug in the MH class, but I haven't
looked at that yet.

File Added: mailbox-unified2-test.diff

--

Comment By: A.M. Kuchling (akuchling)
Date: 2007-01-17 16:06

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

Add mailbox-unified-patch.

File Added: mailbox-unified-patch.diff

--

Comment By: A.M. Kuchling (akuchling)
Date: 2007-01-17 16:05

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

mailbox-pending-lock is the difference between David's copy-back-new +
fcntl-warning and my -unified patch, uploaded so that he can comment on the
changes.

The only change is to make _singleFileMailbox.lock() clear self._toc,
f

[ python-Bugs-1482402 ] Forwarding events and Tk.mainloop problem

2007-01-19 Thread SourceForge.net
Bugs item #1482402, was opened at 2006-05-05 11:15
Message generated for change (Comment added) made by mkiever
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1482402&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Matthias Kievernagel (mkiever)
Assigned to: Martin v. Löwis (loewis)
Summary: Forwarding events and Tk.mainloop problem

Initial Comment:
(Python 2.4.1, tcl/tk 8.4 on Linux)

I try to create a widget class (Frame2 in the example)
containing a Listbox.
This should report an event '<>'
when the Listbox produces '<>'
or when the selection changes using the Up/Down keys.
(see example script)

Binding '<>' to the Frame2 widget
produces the following traceback when the
event is generated:

--
listbox select
event generated
Traceback (most recent call last):
  File "testevent.py", line 98, in ?
tk.mainloop ()
  File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", 
line 965, in mainloop
self.tk.mainloop(n)
  File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", 
line 1349, in __call__
self.widget._report_exception()
  File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", 
line 1112, in _report_exception
root = self._root()
AttributeError: Tk instance has no __call__ method
-

So Tkinter tries to report an exception
caused by the event, but fails to do so
by a second exception in _report_exception.
(not quite sure I did understand this)
The first exception may be a problem with
my code or tcl/tk but at least the second
is a problem of Tkinter.

If you bind '<>' to Tk itself
the example works fine.


--

>Comment By: Matthias Kievernagel (mkiever)
Date: 2007-01-19 15:43

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

I just found the time to re-investigate my reported bug
and found out that it is due to a subclassing error
of my own (redefine of Misc._root()).
Sorry, for the false report.
Can someone delete/reject or shoot it down?

Greetings,
Matthias Kievernagel


--

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



[ python-Bugs-1635892 ] description of the beta distribution is incorrect

2007-01-19 Thread SourceForge.net
Bugs item #1635892, was opened at 2007-01-15 08:59
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1635892&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.6
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: elgordo (azgordo)
Assigned to: Nobody/Anonymous (nobody)
Summary: description of the beta distribution is incorrect

Initial Comment:
In the random module, the documentation is incorrect. Specifically, the limits 
on the parameters for the beta-distribution should be changed from ">-1" to 
">0". This parallels to (correct) limits on the parameters for the 
gamma-distribution.

--

>Comment By: Raymond Hettinger (rhettinger)
Date: 2007-01-19 13:07

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

Fixed in revs 53498 and 53499.

--

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



[ python-Feature Requests-1639002 ] add type defintion support

2007-01-19 Thread SourceForge.net
Feature Requests item #1639002, was opened at 2007-01-18 21:53
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1639002&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.6
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: djnet (djnet)
Assigned to: Nobody/Anonymous (nobody)
Summary: add type defintion support

Initial Comment:
Hi,

I'm used to java language.
When i use a good java ide, the autocompletion is very effective (python cannot 
be such effective).
ex, if i enter following text:
  Date lDate=new Date();
  lDate.[TAB_KEY]
then the editor can display all the methods available for my 'lDate' object; it 
can because it knows the object's type.
This is very convenient and allows to use a new API without browsing the API 
documentation !


I think such autocompletion could be achieved in python simply: it only need a 
"type definition" syntax.
Of course, the type definition should NOT be MANDATORY !

So, is this a good idea ?

David





--

>Comment By: Georg Brandl (gbrandl)
Date: 2007-01-19 18:10

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

If what you're suggesting is static typing, please go to the python-ideas
mailing list and discuss it there. Changes of a scope that large shouldn't
be discussed in a issue tracker.

--

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



[ python-Bugs-1602742 ] itemconfigure returns incorrect text property of text items

2007-01-19 Thread SourceForge.net
Bugs item #1602742, was opened at 2006-11-25 16:27
Message generated for change (Comment added) made by mkiever
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1602742&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Wojciech Mula (wmula)
Assigned to: Martin v. Löwis (loewis)
Summary: itemconfigure returns incorrect text property of text items

Initial Comment:
Tkinter: canvas itemconfigure bug

Consider following code:

-- tkbug.py ---
from Tkinter import *
root   = Tk()
canvas = Canvas(root)
text   = "sample text with spaces"
id = canvas.create_text(0, 0, text=text)

text2  = canvas.itemconfigure(id)['text'][-1]

print text
print text2
--- eof ---

This toy prints:

sample text with spaces
('sample', 'text', 'with', 'spaces')

The returned value is not a string -- Tk returns the same
string as passed on creating item, but Tkinter split it.
To fix this problem, internal method '_configure' have
to be changed a bit:

*** Tkinter.py.old  2006-11-20 16:48:27.0 +0100
--- Tkinter.py  2006-11-20 17:00:13.0 +0100
***
*** 1122,1129 
  cnf = _cnfmerge(cnf)
  if cnf is None:
  cnf = {}
! for x in self.tk.split(
  self.tk.call(_flatten((self._w, cmd:
  cnf[x[0][1:]] = (x[0][1:],) + x[1:]
  return cnf
  if type(cnf) is StringType:
--- 1122,1134 
  cnf = _cnfmerge(cnf)
  if cnf is None:
  cnf = {}
! for x in self.tk.splitlist(
  self.tk.call(_flatten((self._w, cmd:
+ if type(x) is StringType:
+ if x.startswith('-text '):
+ x = self.tk.splitlist(x)
+ else:
+ x = self.tk.split(x)
  cnf[x[0][1:]] = (x[0][1:],) + x[1:]
  return cnf
  if type(cnf) is StringType:


Maybe better/faster way is to provide Canvas method, that
return a 'text' property for text items:

---
def get_text(self, text_id):
try:
r = self.tk.call(self._w, 'itemconfigure', text_id, '-text')
return self.tk.splitlist(r)[-1]
except TclError:
return ''
---


--

Comment By: Matthias Kievernagel (mkiever)
Date: 2007-01-19 18:35

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

There is a simple workaround: use itemcget.

The error applies to other options as well:
  dash, activedash, disableddash, tags, arrowshape, font
These options also may contain a space in their value.
I collected this information from 'man n Canvas' from Tk 8.4.6
I hope I didn't miss any.

BTW the itemconfigure document string is broken.

Greetings,
Matthias Kievernagel


--

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



[ python-Bugs-1626545 ] Would you mind renaming object.h to pyobject.h?

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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Anton Tropashko (atropashko)
Assigned to: Nobody/Anonymous (nobody)
Summary: Would you mind renaming object.h to pyobject.h?

Initial Comment:
Would be nice if you could change object.h
to pyobject.h or something like that.
object.h is a common name found in kjs
and Qt :-(
Thank you!

The patch is against 2.4

--- Makefile.pre.in 2 Jan 2007 20:03:09 -   1.3
+++ Makefile.pre.in 2 Jan 2007 23:52:47 -
@@ -522,7 +522,7 @@
Include/methodobject.h \
Include/modsupport.h \
Include/moduleobject.h \
-   Include/object.h \
+   Include/pyobject.h \
Include/objimpl.h \
Include/patchlevel.h \
Include/pydebug.h \
Index: configure
===
RCS file: /cvsroot/faultline/python/configure,v
retrieving revision 1.2
diff -d -u -r1.2 configure
--- configure   30 Dec 2006 02:55:53 -  1.2
+++ configure   2 Jan 2007 23:52:49 -
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.1.1.1 .
+# From configure.in Revision: 1.2 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for python 2.4.
 #
@@ -274,7 +274,7 @@
 PACKAGE_STRING='python 2.4'
 PACKAGE_BUGREPORT='http://www.python.org/python-bugs'
 
-ac_unique_file="Include/object.h"
+ac_unique_file="Include/pyobject.h"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include 
Index: configure.in
===
RCS file: /cvsroot/faultline/python/configure.in,v
retrieving revision 1.2
diff -d -u -r1.2 configure.in
--- configure.in30 Dec 2006 02:55:53 -  1.2
+++ configure.in2 Jan 2007 23:52:49 -
@@ -6,7 +6,7 @@
 AC_REVISION($Revision: 1.2 $)
 AC_PREREQ(2.53)
 AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
-AC_CONFIG_SRCDIR([Include/object.h])
+AC_CONFIG_SRCDIR([Include/pyobject.h])
 AC_CONFIG_HEADER(pyconfig.h)
 
 dnl This is for stuff that absolutely must end up in pyconfig.h.
Index: Include/Python.h
===
RCS file: /cvsroot/faultline/python/Include/Python.h,v
retrieving revision 1.1.1.1
diff -d -u -r1.1.1.1 Python.h
--- Include/Python.h28 Dec 2006 18:35:20 -  1.1.1.1
+++ Include/Python.h2 Jan 2007 23:52:51 -
@@ -73,7 +73,7 @@
 #endif
 #include "pymem.h"
 
-#include "object.h"
+#include "pyobject.h"
 #include "objimpl.h"
 
 #include "pydebug.h"
Index: Parser/tokenizer.h
===
RCS file: /cvsroot/faultline/python/Parser/tokenizer.h,v
retrieving revision 1.1.1.1
diff -d -u -r1.1.1.1 tokenizer.h
--- Parser/tokenizer.h  28 Dec 2006 18:35:31 -  1.1.1.1
+++ Parser/tokenizer.h  2 Jan 2007 23:52:54 -
@@ -4,7 +4,7 @@
 extern "C" {
 #endif
 
-#include "object.h"
+#include "pyobject.h"
 
 /* Tokenizer interface */


--

>Comment By: Anton Tropashko (atropashko)
Date: 2007-01-19 10:47

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

slots member conflicts with Qt. I renamed it also. Patch follows:

--- Include/pyobject.h  3 Jan 2007 00:06:11 -   1.1
+++ Include/pyobject.h  19 Jan 2007 18:43:13 -
@@ -340,7 +340,7 @@
  a given operator (e.g. __getitem__).
  see add_operators() in typeobject.c . 
*/
PyBufferProcs as_buffer;
-   PyObject *name, *slots;
+   PyObject *name, *slots_;
/* here are optional user slots, followed by the members. */
 } PyHeapTypeObject;
 
Index: Objects/typeobject.c
===
RCS file: /cvsroot/faultline/python/Objects/typeobject.c,v
retrieving revision 1.1.1.1
diff -d -u -r1.1.1.1 typeobject.c
--- Objects/typeobject.c28 Dec 2006 18:35:24 -  1.1.1.1
+++ Objects/typeobject.c19 Jan 2007 18:43:13 -
@@ -1811,7 +1811,7 @@
et = (PyHeapTypeObject *)type;
Py_INCREF(name);
et->name = name;
-   et->slots = slots;
+   et->slots_ = slots;
 
/* Initialize tp_flags */
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE |
@@ -2116,7 +2116,7 @@
Py_XDECREF(type->tp_subclasses);
PyObject_Free(type->tp_doc);
Py_XDEC

[ python-Bugs-1626545 ] Would you mind renaming object.h to pyobject.h?

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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: Python Library
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Anton Tropashko (atropashko)
Assigned to: Nobody/Anonymous (nobody)
Summary: Would you mind renaming object.h to pyobject.h?

Initial Comment:
Would be nice if you could change object.h
to pyobject.h or something like that.
object.h is a common name found in kjs
and Qt :-(
Thank you!

The patch is against 2.4

--- Makefile.pre.in 2 Jan 2007 20:03:09 -   1.3
+++ Makefile.pre.in 2 Jan 2007 23:52:47 -
@@ -522,7 +522,7 @@
Include/methodobject.h \
Include/modsupport.h \
Include/moduleobject.h \
-   Include/object.h \
+   Include/pyobject.h \
Include/objimpl.h \
Include/patchlevel.h \
Include/pydebug.h \
Index: configure
===
RCS file: /cvsroot/faultline/python/configure,v
retrieving revision 1.2
diff -d -u -r1.2 configure
--- configure   30 Dec 2006 02:55:53 -  1.2
+++ configure   2 Jan 2007 23:52:49 -
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.1.1.1 .
+# From configure.in Revision: 1.2 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for python 2.4.
 #
@@ -274,7 +274,7 @@
 PACKAGE_STRING='python 2.4'
 PACKAGE_BUGREPORT='http://www.python.org/python-bugs'
 
-ac_unique_file="Include/object.h"
+ac_unique_file="Include/pyobject.h"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include 
Index: configure.in
===
RCS file: /cvsroot/faultline/python/configure.in,v
retrieving revision 1.2
diff -d -u -r1.2 configure.in
--- configure.in30 Dec 2006 02:55:53 -  1.2
+++ configure.in2 Jan 2007 23:52:49 -
@@ -6,7 +6,7 @@
 AC_REVISION($Revision: 1.2 $)
 AC_PREREQ(2.53)
 AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
-AC_CONFIG_SRCDIR([Include/object.h])
+AC_CONFIG_SRCDIR([Include/pyobject.h])
 AC_CONFIG_HEADER(pyconfig.h)
 
 dnl This is for stuff that absolutely must end up in pyconfig.h.
Index: Include/Python.h
===
RCS file: /cvsroot/faultline/python/Include/Python.h,v
retrieving revision 1.1.1.1
diff -d -u -r1.1.1.1 Python.h
--- Include/Python.h28 Dec 2006 18:35:20 -  1.1.1.1
+++ Include/Python.h2 Jan 2007 23:52:51 -
@@ -73,7 +73,7 @@
 #endif
 #include "pymem.h"
 
-#include "object.h"
+#include "pyobject.h"
 #include "objimpl.h"
 
 #include "pydebug.h"
Index: Parser/tokenizer.h
===
RCS file: /cvsroot/faultline/python/Parser/tokenizer.h,v
retrieving revision 1.1.1.1
diff -d -u -r1.1.1.1 tokenizer.h
--- Parser/tokenizer.h  28 Dec 2006 18:35:31 -  1.1.1.1
+++ Parser/tokenizer.h  2 Jan 2007 23:52:54 -
@@ -4,7 +4,7 @@
 extern "C" {
 #endif
 
-#include "object.h"
+#include "pyobject.h"
 
 /* Tokenizer interface */


--

Comment By: Anton Tropashko (atropashko)
Date: 2007-01-19 10:47

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

slots member conflicts with Qt. I renamed it also. Patch follows:

--- Include/pyobject.h  3 Jan 2007 00:06:11 -   1.1
+++ Include/pyobject.h  19 Jan 2007 18:43:13 -
@@ -340,7 +340,7 @@
  a given operator (e.g. __getitem__).
  see add_operators() in typeobject.c . 
*/
PyBufferProcs as_buffer;
-   PyObject *name, *slots;
+   PyObject *name, *slots_;
/* here are optional user slots, followed by the members. */
 } PyHeapTypeObject;
 
Index: Objects/typeobject.c
===
RCS file: /cvsroot/faultline/python/Objects/typeobject.c,v
retrieving revision 1.1.1.1
diff -d -u -r1.1.1.1 typeobject.c
--- Objects/typeobject.c28 Dec 2006 18:35:24 -  1.1.1.1
+++ Objects/typeobject.c19 Jan 2007 18:43:13 -
@@ -1811,7 +1811,7 @@
et = (PyHeapTypeObject *)type;
Py_INCREF(name);
et->name = name;
-   et->slots = slots;
+   et->slots_ = slots;
 
/* Initialize tp_flags */
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE |
@@ -2116,7 +2116,7 @@
Py_XDECREF(type->tp_subclasses);
PyObject_Free(type->tp_doc);
   

[ python-Bugs-1600182 ] Tix ComboBox entry is blank when not editable

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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tim Wegener (twegener)
Assigned to: Martin v. Löwis (loewis)
Summary: Tix ComboBox entry is blank when not editable

Initial Comment:
When setting editable=False for Tix.ComboBox, when selecting an item from the 
combo box, the selected item should appear in the entry field. In Windows this 
does not happen, and the entry field is dark grey and blank. 

When editable=True the label is visible.

Problem occurs in:
Python 2.3.5 (Windows)
Python 2.4.4 (Windows)
(the above appear to use tk 8.4)

Works fine in:
Python 2.2.2 (Red Hat 9)
Python 2.3.5 (Red Hat 9)
Python 2.4.1 (Red Hat 9)
Python 2.5 (Red Hat 9)
(all of the above with tk 8.3.5, tix 8.1.4)


--

Comment By: Matthias Kievernagel (mkiever)
Date: 2007-01-19 19:48

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

Or it might just be a problem with default colours.
On my Linux box the selected item is hard to read.
The shades of grey are very similar.
Try changing the colours
(disabledforeground/disabledbackground/readonlybackground).

This is most probably no Python bug, as options
are sent to the Tcl-Interpreter mostly without any change
or magic.

Greetings,
Matthias Kievernagel


--

Comment By: Tim Wegener (twegener)
Date: 2006-11-21 05:43

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

The following workaround does the job:

entry = combobox.subwidget_list['entry']
entry.config(state='readonly')

It appears that when doing ComboBox(editable=False) the Entry widget is
being set to DISABLED rather than 'readonly'. 


--

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



[ python-Bugs-1600182 ] Tix ComboBox entry is blank when not editable

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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tim Wegener (twegener)
Assigned to: Martin v. Löwis (loewis)
Summary: Tix ComboBox entry is blank when not editable

Initial Comment:
When setting editable=False for Tix.ComboBox, when selecting an item from the 
combo box, the selected item should appear in the entry field. In Windows this 
does not happen, and the entry field is dark grey and blank. 

When editable=True the label is visible.

Problem occurs in:
Python 2.3.5 (Windows)
Python 2.4.4 (Windows)
(the above appear to use tk 8.4)

Works fine in:
Python 2.2.2 (Red Hat 9)
Python 2.3.5 (Red Hat 9)
Python 2.4.1 (Red Hat 9)
Python 2.5 (Red Hat 9)
(all of the above with tk 8.3.5, tix 8.1.4)


--

Comment By: Matthias Kievernagel (mkiever)
Date: 2007-01-19 19:55

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

Or it might just be a problem with default colours.
On my Linux box the selected item is hard to read.
The shades of grey are very similar.
Try changing the colours
(disabledforeground/disabledbackground/readonlybackground).

This is most probably no Python bug, as options
are sent to the Tcl-Interpreter mostly without any change
or magic.

Greetings,
Matthias Kievernagel


--

Comment By: Matthias Kievernagel (mkiever)
Date: 2007-01-19 19:48

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

Or it might just be a problem with default colours.
On my Linux box the selected item is hard to read.
The shades of grey are very similar.
Try changing the colours
(disabledforeground/disabledbackground/readonlybackground).

This is most probably no Python bug, as options
are sent to the Tcl-Interpreter mostly without any change
or magic.

Greetings,
Matthias Kievernagel


--

Comment By: Tim Wegener (twegener)
Date: 2006-11-21 05:43

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

The following workaround does the job:

entry = combobox.subwidget_list['entry']
entry.config(state='readonly')

It appears that when doing ComboBox(editable=False) the Entry widget is
being set to DISABLED rather than 'readonly'. 


--

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



[ python-Bugs-1581476 ] Text search gives bad count if called from variable trace

2007-01-19 Thread SourceForge.net
Bugs item #1581476, was opened at 2006-10-20 19:26
Message generated for change (Comment added) made by mkiever
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1581476&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Russell Owen (reowen)
Assigned to: Martin v. Löwis (loewis)
Summary: Text search gives bad count if called from variable trace

Initial Comment:
If Text search is called from a variable trace then the count variable is 
not be updated.

I see this with Python 2.4.3 and Aqua Tcl/Tk 8.4.11 on MacOS X 10.4.7. 
I have not tested it elsewhere.

Note that this works fine in tcl/tk so this appears to be a Tkinter issue.

To see the problem run the attached python script.

(The script also includes the equivalent tcl/tk code in its comments, so 
you can easily test the issue directly in tcl/tk if desired.)

--

Comment By: Matthias Kievernagel (mkiever)
Date: 2007-01-19 20:50

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

Same behaviour on Linux and current Python trunk.
In addition I get an IndexError, if I delete the
last character of the search string.
Does Tk allow calling search with an empty pattern?

Tkinter could handle this (with a correct result)
with the following change in Tkinter.py / Text.search():

if pattern[0] == '-': args.append('--')
->
if pattern and pattern[0] == '-': args.append('--')

Greetings,
Matthias Kievernagel

--

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



[ python-Bugs-1482402 ] Forwarding events and Tk.mainloop problem

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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Matthias Kievernagel (mkiever)
Assigned to: Martin v. Löwis (loewis)
Summary: Forwarding events and Tk.mainloop problem

Initial Comment:
(Python 2.4.1, tcl/tk 8.4 on Linux)

I try to create a widget class (Frame2 in the example)
containing a Listbox.
This should report an event '<>'
when the Listbox produces '<>'
or when the selection changes using the Up/Down keys.
(see example script)

Binding '<>' to the Frame2 widget
produces the following traceback when the
event is generated:

--
listbox select
event generated
Traceback (most recent call last):
  File "testevent.py", line 98, in ?
tk.mainloop ()
  File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", 
line 965, in mainloop
self.tk.mainloop(n)
  File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", 
line 1349, in __call__
self.widget._report_exception()
  File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", 
line 1112, in _report_exception
root = self._root()
AttributeError: Tk instance has no __call__ method
-

So Tkinter tries to report an exception
caused by the event, but fails to do so
by a second exception in _report_exception.
(not quite sure I did understand this)
The first exception may be a problem with
my code or tcl/tk but at least the second
is a problem of Tkinter.

If you bind '<>' to Tk itself
the example works fine.


--

>Comment By: Martin v. Löwis (loewis)
Date: 2007-01-20 00:44

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

Closing as invalid, as requested.

--

Comment By: Matthias Kievernagel (mkiever)
Date: 2007-01-19 16:43

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

I just found the time to re-investigate my reported bug
and found out that it is due to a subclassing error
of my own (redefine of Misc._root()).
Sorry, for the false report.
Can someone delete/reject or shoot it down?

Greetings,
Matthias Kievernagel


--

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



[ python-Bugs-1629566 ] documentation of email.utils.parsedate is confusing

2007-01-19 Thread SourceForge.net
Bugs item #1629566, was opened at 2007-01-06 15:37
Message generated for change (Comment added) made by mark-roberts
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1629566&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nicholas Riley (nriley)
Assigned to: Nobody/Anonymous (nobody)
Summary: documentation of email.utils.parsedate is confusing

Initial Comment:
This sentence in the documentation for email.utils.parsedate confused me:

"Note that fields 6, 7, and 8 of the result tuple are not usable."

These indices are zero-based, so it's actually fields 7, 8 and 9 that they are 
talking about (in normal English).  Either this should be changed to 7-9 or be 
re-expressed in a way that makes it clear it's zero-based, for example by using 
Python indexing notation.

Thanks.

--

Comment By: Mark Roberts (mark-roberts)
Date: 2007-01-19 19:16

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

Link to document in question:
http://www.python.org/doc/lib/module-email.utils.html

www.python.org/sf/1639973 for doc patch

--

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



[ python-Bugs-1620945 ] minor inconsistency in socket.close

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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jonathan Ellis (ellisj)
Assigned to: Nobody/Anonymous (nobody)
Summary: minor inconsistency in socket.close

Initial Comment:
In python 2.5 socket.close, all methods are delegated to _dummy, which raises 
an error.  It would be more consistent to delegate each method to its 
counterpart in _closedsocket; in particular re-closing a closed socket is not 
intended to raise:

def close(self):
self._sock.close()
self._sock = _closedsocket()
for method in _delegate_methods:
setattr(self, method, getattr(self._sock, method))


--

Comment By: Mark Roberts (mark-roberts)
Date: 2007-01-19 19:51

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

On trunk:

>>> import socket
>>> s=socket.socket()
>>> s.close()
>>> s.close()
>>> 

It also seems that the following line will make even that remapping not
useful?  Isn't it better just to avoid the layer of indirection and
directly proceed with assigning to _dummy?

line 145: send = recv = recv_into = sendto = recvfrom = recvfrom_into =
_dummy

--

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