[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Walter Dörwald

Walter Dörwald added the comment:

Because it's not clear whether b'\xa0' *is* whitespace or not. Bytes
have no meaning, characters do.

--
nosy: +doerwalter

__
Tracker <[EMAIL PROTECTED]>

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



[issue1113] interrupt_main() fails to interrupt raw_input()

2007-09-07 Thread Anand Patil

Anand Patil added the comment:

OK, thanks for your help.

On 9/6/07, Georg Brandl <[EMAIL PROTECTED]> wrote:
>
>
> Georg Brandl added the comment:
>
> Anand Patil schrieb:
> > Anand Patil added the comment:
> >
> > Sorry- Where can I get this patch? The SourceForge patch manager says
> it's
> > closed.
>
> It is - like all other issues - in this tracker at
> http://bugs.python.org/706406.
>
> __
> Tracker <[EMAIL PROTECTED]>
> 
> __
>

__
Tracker <[EMAIL PROTECTED]>

__OK, thanks for your help.On 9/6/07, Georg Brandl [EMAIL PROTECTED]> wrote:
Georg Brandl added the comment:Anand Patil schrieb:> Anand 
Patil added the comment:>> Sorry- Where can I get this patch? The 
SourceForge patch manager says it's> closed.
It is - like all other issues - in this tracker at http://bugs.python.org/706406";>http://bugs.python.org/706406.__Tracker
 
[EMAIL PROTECTED]>http://bugs.python.org/issue1113>__

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



[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Nir Soffer

Nir Soffer added the comment:

Why bytes should not use a default whitespace split behavior as str?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1128] msilib.Directory.make_short only handles file names with a single dot in them

2007-09-07 Thread Anthony Tuininga

New submission from 
Anthony Tuininga
:

Attached is a patch that fixes the handling of file names with 0 or 2 or
more dots in them.

--
components: Library (Lib)
files: msilib.__init__.patch
messages: 55736
nosy: atuining
severity: normal
status: open
title: msilib.Directory.make_short only handles file names with a single dot in 
them
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__

msilib.__init__.patch
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1128] msilib.Directory.make_short only handles file names with a single dot in them

2007-09-07 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
assignee:  -> loewis
keywords: +patch
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1708326] imp.find_module doc ambiguity

2007-09-07 Thread Georg Brandl

Changes by Georg Brandl:


--
status: pending -> closed

_
Tracker <[EMAIL PROTECTED]>

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



[issue1767242] os.chmod failure

2007-09-07 Thread Georg Brandl

Changes by Georg Brandl:


--
status: pending -> closed

_
Tracker <[EMAIL PROTECTED]>

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



[issue1209562] add single html files

2007-09-07 Thread Georg Brandl

Changes by Georg Brandl:


--
status: pending -> closed

_
Tracker <[EMAIL PROTECTED]>

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



[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Guido van Rossum

Guido van Rossum added the comment:

I tend to agree with the author; I've run into this myself. For
whitespace, I propose to use only the following: tab LF FF VT CR space.
These are the whitespace ASCII characters according to isspace() in libc.

(Unicode also treats hex 1C, 1D, 1E and 1F as whitespace; I have no idea
what these mean. In practice I don't think it matters either way.)

--
assignee:  -> gvanrossum
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Guido van Rossum

Changes by Guido van Rossum:


__
Tracker <[EMAIL PROTECTED]>

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



[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-07 Thread Guido van Rossum

Changes by Guido van Rossum:


__
Tracker <[EMAIL PROTECTED]>

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



[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-07 Thread Guido van Rossum

Changes by Guido van Rossum:


__
Tracker <[EMAIL PROTECTED]>

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



[issue1124] Webchecker not parsing css "@import url"

2007-09-07 Thread Guido van Rossum

Guido van Rossum added the comment:

This is essentially unsupported and unmaintaned example code.  Feel free
to submit a patch though!

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1749583] expanduser("~") on Windows looks for HOME first

2007-09-07 Thread Georg Brandl

Changes by Georg Brandl:


--
status: pending -> closed

_
Tracker <[EMAIL PROTECTED]>

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



[issue1764044] copy 2

2007-09-07 Thread robs pythonid


robs pythonid
 added the comment:

Thanks for your reaction, I do not really now the answer to your 
question but I added the code to copy files in a directory (to keep it 
simple I removed the recursiveness):

import os
import shutil

sourcedir="d:\\testsourcedir"
targetdir="d:\\testtargetdir"

filelist=os.listdir(sourcedir)  
for afile in filelist:
source=sourcedir + "\\" + afile
if os.path.isfile(source):
time1=os.path.getmtime(source)
print source,time1,
docopy=0
target=targetdir+"\\"+afile
if os.path.isfile(target):
time2=os.path.getmtime(target)
if time1>time2:
docopy=1
else:
docopy=1
if docopy==1:
print " copying"
shutil.copy2(source,target)
else:
print " not copied"

If I run this program twice without changing any file in the source 
directory it should not copy any files anymore (but is does 20% of the 
files it there are 10 files). Now that I have been thinking about 
this a little the problems I see, happen on a Windows Vista Business 
machine, on my XP machine i don't seem to be able to reproduce the 
issues, maybe it is somethin in Vista.

quite frustrating

_
Tracker <[EMAIL PROTECTED]>

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



[issue1129] OpenSSL detection broken for Python 3.0a1

2007-09-07 Thread Stefan Sonnenberg-Carstens

New submission from Stefan Sonnenberg-Carstens:

In line 618 the comparison must be this:

if (openssl_ver >= 0x00908000):

otherwise there are complaints about not being able to build
the _sha256 and _sha512 modules, even if OpenSSL >= 0.9.8 is installed,
as in my case.

--
components: Build
messages: 55739
nosy: pythonmeister
severity: major
status: open
title: OpenSSL detection broken for Python 3.0a1
type: compile error
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue1095] make install failed

2007-09-07 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I haven't tested it, but it looks fine to me.

--
assignee:  -> georg.brandl
resolution:  -> accepted

__
Tracker <[EMAIL PROTECTED]>

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



[issue1129] OpenSSL detection broken for Python 3.0a1

2007-09-07 Thread Stefan Sonnenberg-Carstens

Stefan Sonnenberg-Carstens added the comment:

Patch attached:

--- setup.py2007-09-07 16:08:05.0 -0400
+++ ../Python-3.0a1_SSC/setup.py2007-09-07 16:07:31.0 -0400
@@ -613,7 +613,7 @@
 else:
 missing.append('_hashlib')

-if (openssl_ver < 0x00908000):
+if (openssl_ver >= 0x00908000):
 # OpenSSL doesn't do these until 0.9.8 so we'll bring our
own hash
 exts.append( Extension('_sha256', ['sha256module.c']) )
 exts.append( Extension('_sha512', ['sha512module.c']) )

__
Tracker <[EMAIL PROTECTED]>

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



[issue1095] make install failed

2007-09-07 Thread Georg Brandl

Georg Brandl added the comment:

Committed as rev. 58043, 58044.

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

__
Tracker <[EMAIL PROTECTED]>

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



[issue1126] file.fileno and file.isatty() should be implementable by any file like object

2007-09-07 Thread Stefan Sonnenberg-Carstens

Stefan Sonnenberg-Carstens added the comment:

You are free to do what you want.
Reasons for not implementing fileno and isatty are:
- fileno should be an integer pointing to a real file,
so that low-level functions in libc can handle that. Can you provide
such ? (see http://netbsd.gw.com/cgi-bin/man-cgi?open++NetBSD-current)
- duck-typing / there must be a difference to "real" files in the first
sense

--
nosy: +pythonmeister

__
Tracker <[EMAIL PROTECTED]>

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



[issue1129] OpenSSL detection broken for Python 3.0a1

2007-09-07 Thread Georg Brandl

Georg Brandl added the comment:

I think you misunderstood the setup.py message; from OpenSSL 0.9.8, building
the _sha modules is not needed.  That they are reported as not built is a
bug which has been fixed now in SVN.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Guido van Rossum

Guido van Rossum added the comment:

Here's a patch that fixes bytes.split and .rsplit.  I'll hold off for a
while in case there's strong disagreement.  I might add a patch for
bytes.strip later (it's simpler).

--
keywords: +patch

__
Tracker <[EMAIL PROTECTED]>

__Index: Objects/bytesobject.c
===
--- Objects/bytesobject.c	(revision 58048)
+++ Objects/bytesobject.c	(working copy)
@@ -2104,7 +2104,7 @@
 Py_LOCAL_INLINE(PyObject *)
 split_char(const char *s, Py_ssize_t len, char ch, Py_ssize_t maxcount)
 {
-register Py_ssize_t i, j, count=0;
+register Py_ssize_t i, j, count = 0;
 PyObject *str;
 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
 
@@ -2113,7 +2113,7 @@
 
 i = j = 0;
 while ((j < len) && (maxcount-- > 0)) {
-for(; j list of bytes\n\
+"B.split([sep [, maxsplit]]) -> list of bytes\n\
 \n\
 Return a list of the bytes in the string B, using sep as the\n\
-delimiter.  If maxsplit is given, at most maxsplit\n\
-splits are done.");
+delimiter.  If sep is not given, B is split on ASCII whitespace\n\
+characters (space, tab, return, newline, formfeed, vertical tab).\n\
+If maxsplit is given, at most maxsplit splits are done.");
 
 static PyObject *
 bytes_split(PyBytesObject *self, PyObject *args)
 {
 Py_ssize_t len = PyBytes_GET_SIZE(self), n, i, j;
-Py_ssize_t maxsplit = -1, count=0;
+Py_ssize_t maxsplit = -1, count = 0;
 const char *s = PyBytes_AS_STRING(self), *sub;
-PyObject *list, *str, *subobj;
+PyObject *list, *str, *subobj = Py_None;
 #ifdef USE_FAST
 Py_ssize_t pos;
 #endif
 
-if (!PyArg_ParseTuple(args, "O|n:split", &subobj, &maxsplit))
+if (!PyArg_ParseTuple(args, "|On:split", &subobj, &maxsplit))
 return NULL;
 if (maxsplit < 0)
 maxsplit = PY_SSIZE_T_MAX;
+
+if (subobj == Py_None)
+return split_whitespace(s, len, maxsplit);
+
 if (PyBytes_Check(subobj)) {
 sub = PyBytes_AS_STRING(subobj);
 n = PyBytes_GET_SIZE(subobj);
@@ -2167,7 +2211,7 @@
 PyErr_SetString(PyExc_ValueError, "empty separator");
 return NULL;
 }
-else if (n == 1)
+if (n == 1)
 return split_char(s, len, sub[0], maxsplit);
 
 list = PyList_New(PREALLOC_SIZE(maxsplit));
@@ -2293,26 +2337,71 @@
 return NULL;
 }
 
+Py_LOCAL_INLINE(PyObject *)
+rsplit_whitespace(const char *s, Py_ssize_t len, Py_ssize_t maxcount)
+{
+register Py_ssize_t i, j, count = 0;
+PyObject *str;
+PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
+
+if (list == NULL)
+return NULL;
+
+for (i = j = len - 1; i >= 0; ) {
+	/* find a token */
+	while (i >= 0 && Py_UNICODE_ISSPACE(s[i]))
+	i--;
+	j = i;
+	while (i >= 0 && !Py_UNICODE_ISSPACE(s[i]))
+	i--;
+	if (j > i) {
+	if (maxcount-- <= 0)
+		break;
+	SPLIT_ADD(s, i + 1, j + 1);
+	while (i >= 0 && Py_UNICODE_ISSPACE(s[i]))
+		i--;
+	j = i;
+	}
+}
+if (j >= 0) {
+	SPLIT_ADD(s, 0, j + 1);
+}
+FIX_PREALLOC_SIZE(list);
+if (PyList_Reverse(list) < 0)
+goto onError;
+
+return list;
+
+  onError:
+Py_DECREF(list);
+return NULL;
+}
+
 PyDoc_STRVAR(rsplit__doc__,
 "B.rsplit(sep [,maxsplit]) -> list of bytes\n\
 \n\
 Return a list of the sections in the byte B, using sep as the\n\
 delimiter, starting at the end of the bytes and working\n\
-to the front.  If maxsplit is given, at most maxsplit splits are\n\
-done.");
+to the front.  If sep is not given, B is split on ASCII whitespace\n\
+characters (space, tab, return, newline, formfeed, vertical tab).\n\
+If maxsplit is given, at most maxsplit splits are done.");
 
 static PyObject *
 bytes_rsplit(PyBytesObject *self, PyObject *args)
 {
 Py_ssize_t len = PyBytes_GET_SIZE(self), n, i, j;
-Py_ssize_t maxsplit = -1, count=0;
+Py_ssize_t maxsplit = -1, count = 0;
 const char *s = PyBytes_AS_STRING(self), *sub;
-PyObject *list, *str, *subobj;
+PyObject *list, *str, *subobj = Py_None;
 
-if (!PyArg_ParseTuple(args, "O|n:rsplit", &subobj, &maxsplit))
+if (!PyArg_ParseTuple(args, "|On:rsplit", &subobj, &maxsplit))
 return NULL;
 if (maxsplit < 0)
 maxsplit = PY_SSIZE_T_MAX;
+
+if (subobj == Py_None)
+return rsplit_whitespace(s, len, maxsplit);
+
 if (PyBytes_Check(subobj)) {
 sub = PyBytes_AS_STRING(subobj);
 n = PyBytes_GET_SIZE(subobj);
Index: Lib/test/test_bytes.py
===
--- Lib/test/test_bytes.py	(revision 58048)
+++ Lib/test/test_bytes.py	(working copy)
@@ -617,17 +617,35 @@
 self.assertEqual(b.split(b'i'), [b'm', b'ss', b'ss', b'pp', b''])
 self.assertEqual(b.split(b'ss'), [b'mi', b'i', b'ippi'])
 self.assertEqual(b.split(b'w'), [b])
-# require an arg (no magic whites

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Guido van Rossum

Changes by Guido van Rossum:


--
components: +Interpreter Core -Library (Lib)
type: rfe -> behavior

__
Tracker <[EMAIL PROTECTED]>

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



[issue1130] Idle - Save (buffer)

2007-09-07 Thread Carl Trachte

Changes by Carl Trachte:


--
components: IDLE
severity: normal
status: open
title: Idle - Save (buffer)
type: behavior
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue1130] Idle - Save (buffer) - closes IDLE and does not save file (Windows XP)

2007-09-07 Thread Carl Trachte

Changes by Carl Trachte:


--
title: Idle - Save (buffer) -> Idle - Save (buffer) - closes IDLE and does not 
save file (Windows XP)

__
Tracker <[EMAIL PROTECTED]>

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