[issue1427] Error in standard module calendar

2007-11-12 Thread Walter Dörwald

Walter Dörwald added the comment:

Fixed in r58942 (trunk) and r58943 (2.5). Closing the issue.

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



[issue1412] test_subprocess fails on SuSE 10

2007-11-12 Thread Denes Vadasz

Denes Vadasz added the comment:

When I say:

$ mkdir -p ~/tmp
$ TMP=3D~/tmp python Lib/tests/test=5Fsubprocess.py

the test is passed.

However with

$ TMP=3D~/tmp make test

the test still fails and the ~/tmp directory is removed during the test 
run.

Regards
Denes Vadasz

Christian Heimes <[EMAIL PROTECTED]> 
To
[EMAIL PROTECTED]
cc

bcc

Subject
[issue1412] test_subprocess fails on SuSE 10

Christian Heimes <[EMAIL PROTECTED]>
Please respond to : Tracker <[EMAIL PROTECTED]>
10/11/2007 23:05

Christian Heimes added the comment:

Please try this:

$ mkdir -p ~/tmp
$ TMP=~/tmp make test

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

__

IMPORTANT  -  CONFIDENTIALITY  NOTICE  - This e-mail is intended only for 
the use of the individual or entity shown above as addressees . It may 
contain information which is privileged, confidential or otherwise 
protected from disclosure under applicable laws .  If the reader of this 
transmission is not the intended recipient, you are hereby notified that 
any dissemination, printing, distribution, copying, disclosure or the 
taking of any action in reliance on the contents of this information is 
strictly prohibited.  If you have received this transmission in error, 
please immediately notify us by reply e-mail or using the address below 
and delete the message and any attachments from your system . 

Amadeus Data Processing GmbH 
Geschäftsführer: Eberhard Haag 
Sitz der Gesellschaft: Erding 
HR München 48 199 
Berghamer Strasse 6 
85435 Erding 
Germany

Added file: http://bugs.python.org/file8738/unnamed

__
Tracker <[EMAIL PROTECTED]>

__
When I say:

$ mkdir -p ~/tmp
$ TMP=3D~/tmp python 
Lib/tests/test=5Fsubprocess.py

the test is passed.

However with

$ TMP=3D~/tmp make test

the test still fails and the ~/tmp directory
is removed during the test run.

Regards
Denes Vadasz





Christian Heimes
<[EMAIL PROTECTED]> 



To
[EMAIL PROTECTED]


cc



bcc



Subject
[issue1412] test_subprocess fails on
SuSE 10







Christian Heimes <[EMAIL 
PROTECTED]>
Please respond to : Tracker
<[EMAIL PROTECTED]>
10/11/2007 23:05



Christian Heimes added the comment:

Please try this:

$ mkdir -p ~/tmp
$ TMP=~/tmp make test

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>
;
__





IMPORTANT  -  CONFIDENTIALITY  NOTICE  - This e-mail
is intended only for the use of the individual or entity shown above as
addressees . It may contain information which is privileged, confidential
or otherwise protected from disclosure under applicable laws .  If
the reader of this transmission is not the intended recipient, you are
hereby notified that any dissemination, printing, distribution, copying,
disclosure or the taking of any action in reliance on the contents of this
information is strictly prohibited.  If you have received this transmission
in error, please immediately notify us by reply e-mail or using the address
below and delete the message and any attachments from your system . 

Amadeus Data Processing GmbH 
Geschäftsführer: Eberhard Haag 
Sitz der Gesellschaft: Erding 
HR München 48 199 
Berghamer Strasse 6 
85435 Erding 
Germany
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1429] FD leak in SocketServer

2007-11-12 Thread Luke-Jr

New submission from Luke-Jr:

SocketServer.ThreadingUnixStreamServer leaks file descriptors when a 
request handler throws an exception.

--
components: Library (Lib)
messages: 57396
nosy: luke-jr
severity: normal
status: open
title: FD leak in SocketServer
versions: Python 2.4

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

I made some checks with the vc2005 (msvcr80) runtime library:
- fd==-2 corresponds to the _NO_CONSOLE_FILENO constant.
A comment in the CRT code says:
/*
 * For stdin, stdout & stderr, we use _NO_CONSOLE_FILENO (a value
 * different from _INVALID_HANDLE_VALUE to distinguish between
 * a failure in opening a file & a program run without a console.
 */

- in this case, stderr is a buffered FILE*, but the flush() method
always fails. This makes not difference for python2.5, because it never
looks at the return value of fprintf (which is not very consistent, BTW).

Since pythonw (2.5) silently discards any output to stderr, we could
achieve the same by opening the nul file...

--- c:/temp/t   2007-11-12 13:54:34.105463200 +0100
+++ c:/afa/python/py3k/Modules/_fileio.c2007-11-12 13:52:42.576675100 
+0100
@@ -149,6 +149,15 @@
 
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|si:fileio",
kwlist, &fd, &mode, &closefd)) {
+#ifdef MS_WINDOWS
+   /* Windows sets the descriptor to _NO_CONSOLE_FILENO when */
+   /* the program is run without a console */
+   if (fd == -2)
+   {
+   fd = open("nul", "r+");
+   }
+   else
+#endif
if (fd < 0) {
PyErr_SetString(PyExc_ValueError,
"Negative filedescriptor");

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

The patch is a good idea. However it doesn't work for VS 2003 and MSVCR71:

import sys
f = open("stderr.txt", "w")
f.write("stdin: %i\n" % sys.stdin.fileno())
f.write("stdout: %i\n" % sys.stdout.fileno())
f.write("stderr: %i\n" % sys.stderr.fileno())

> pythonw.exe pywtest.py
> type stderr.txt
stdin: -1
stdout: -1
stderr: -1

/me sends another hate letter to Redmond.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Doh, you're right:
> c:\python24\pythonw -c "import sys;print sys.stderr.fileno()"|more
-1
> c:\python24-vc8\pythonw -c "import sys;print sys.stderr.fileno()"|more
-2

/me needs to get the code of msvcrt7.

We could simply check for (fd<0) instead, but it's better to reserve
this special processing to stdin/stdout/stderr. maybe somewhere in
pythonrun.c. I'll try a patch later tonight.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1421] python.org: outdated and false information

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

BTW, what's the best way of reporting bugs in python.org?

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1422] Writing to an invalid fd doesn't raise an exception

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't think this is worth fixing; you'll get an I/O error as soon as
I/O is attempted, which is upon the first read() for input, or upon the
firsh (implicit or explicit) flush() on output.  You can't tell whether
a fd is valid or not without attempting I/O on it, so trying to test on
each write() call would defeat the purpose of buffering. Testing on
open() is insufficient as long as anybody could call os.close() any time.

--
nosy: +gvanrossum
resolution:  -> wont fix
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



[issue1420] Unicode literals in tokenize.py and tests.

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm with Martin. Adam, why do you think tokenize should use bytes
instead of text strings?

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1430] Installing on Vista asks to close Explorer (and Nokia PC Suite)

2007-11-12 Thread David Barlow

New submission from David Barlow:

Version 2.5.1.
I'm trying to install Python on 32bit Vista Business. When I run the 
MSI file it proceeds smoothly (well, apart from offering to install 
to "c:\python..." instead of "c:\program files\python..."), and then 
starts the install. It then tells me that I have to close down Explorer 
(i.e. the shell!), and Nokia PC Suite 6.84.10.3. I could cope with the 
latter, but I'm definitely not prepared to exit explorer. This seems a 
bug/oversight in the installer. Is there any wat round it?

--
components: Installation
messages: 57403
nosy: dabarlow
severity: normal
status: open
title: Installing on Vista asks to close Explorer (and Nokia PC Suite)
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue1423] wave sunau aifc 16bit errors

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

What software do you use to play the sample?  Is it perhaps ignoring the
nchannels value from the header?

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1424] py3k: readline and rlcompleter doesn't list choices

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Can't reproduce this (Ubuntu dapper). I get the expected output.

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1420] Unicode literals in tokenize.py and tests.

2007-11-12 Thread Georg Brandl

Georg Brandl added the comment:

Martin, Guido: I think you misunderstand the patch description: it
doesn't make tokenize process bytes instead of bytes, but makes it
tokenize the new b"..." literals instead of the old u"..." literals.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1426] readline module needs a review

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Go for it!

--
nosy: +gvanrossum
priority: high -> normal

__
Tracker <[EMAIL PROTECTED]>

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



[issue1424] py3k: readline and rlcompleter doesn't list choices

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Fixed in r58941 (trunk), r58947 (merge) and r58933

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



[issue1419] ssl module version 1.10 causes TypeError when accepting connection

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

BTW Bill, how's the 3.0 port of SSL going?

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1254] pdb fails to launch some script.

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Fixed in r58950 for Python 2.5. Python 2.6 and 3k are already fixed.

--
nosy: +tiran
resolution:  -> fixed
status: open -> closed
versions: +Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue1420] Unicode literals in tokenize.py and tests.

2007-11-12 Thread Ron Adam

Ron Adam added the comment:

George is correct.  The changes are minimal.

The only addition is to run the tokenize_tests.txt file though compile()
as a way to force an exception if it needs updating in the future.  The
results of the compile are not used.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1421] python.org: outdated and false information

2007-11-12 Thread Georg Brandl

Georg Brandl added the comment:

It used to be the tracker at http://pydotorg.python.org/, but the
PythonWebsiteCreatingNewTickets Wiki page says it's disabled...

__
Tracker <[EMAIL PROTECTED]>

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



[issue1420] Unicode literals in tokenize.py and tests.

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Got it. Checked in as revision 58951.

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



[issue1414] Fix for refleak tests

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Please check in the frozen-related fixes.

Your changes to test_tcl break that test even when run without -R!

For test_pkg, I would rather see a fix that undoes all the changes to
sys.modules (note that it already restores sys.path and deletes the
files it's created, but that's not enough).

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

IMO you don't need the 'closed' flag and you should continue to test for
fd < 0.  Whether it's -1 or -2, you still can't write to it...

__
Tracker <[EMAIL PROTECTED]>

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



[issue1430] Installing on Vista asks to close Explorer (and Nokia PC Suite)

2007-11-12 Thread Martin v. Löwis

Martin v. Löwis added the comment:

This error message is not produced by the Python MSI file, but by
Windows installer itself. It computes the set of files that we are about
to install, which includes the Microsoft C Runtime DLL. I guess that
this file is also in use by Explorer.

It is safe to ignore this warning, and proceed with the installation.

Closing this as a third-party problem.

--
nosy: +loewis
resolution:  -> wont fix
status: open -> closed
versions: +3rd party -Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

W/o the closed flag it's impossible to distinguish between closed fd and
invalid fd.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1423] wave sunau aifc 16bit errors

2007-11-12 Thread jeroen

jeroen added the comment:

I played using winsound.PlaySound function for the wav. I used VLC and windows 
media player for wav,au and aiff after that

All had the same problem. It was solved for sunau by doubling the nframes 
number written by the close function in the sunau module. I assume something 
similar should be done for the wav and aiff modules.

This is what I changed in sunau I am not sure if adding *self._sampwidth breaks 
something else. It works for me now when I create 16bit stereo files.

def _patchheader(self):
self._file.seek(8)
# jjk added * sampwidth otherwise for 16 bit you get wrong nframes
_write_u32(self._file, self._datawritten*self._sampwidth)
self._datalength = self._datawritten
self._file.seek(0, 2)

Hope this helps.
greetings

__
Tracker <[EMAIL PROTECTED]>

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



[issue1414] Fix for refleak tests

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

How do you like;

class TestPkg(unittest.TestCase):

def setUp(self):
self.root = None
self.syspath = list(sys.path)
self.sysmodules = sys.modules.copy()

def tearDown(self):
sys.path[:] = self.syspath
sys.modules.clear()
sys.modules.update(self.sysmodules)
del self.sysmodules
cleanout(self.root)

Or I could use the paranoid approach: create set from sys.modules.keys()
in setUp + tearDown and remove the items that are in the second set but
not in the first set.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1414] Fix for refleak tests

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Fix for test_frozen comitted in r58953

__
Tracker <[EMAIL PROTECTED]>

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



[issue1704621] interpreter crash when multiplying large lists

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Python 2.6 (trunk) is raising a MemoryError in a non-debug build, too.
The problem is fixed in 2.6 and 3.0.

--
versions:  -Python 2.6, 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



[issue1414] Fix for refleak tests

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

If that makes the test pass with and without -R::, go for it!

On Nov 12, 2007 11:14 AM, Christian Heimes <[EMAIL PROTECTED]> wrote:
>
> Christian Heimes added the comment:
>
> How do you like;
>
> class TestPkg(unittest.TestCase):
>
> def setUp(self):
> self.root = None
> self.syspath = list(sys.path)
> self.sysmodules = sys.modules.copy()
>
> def tearDown(self):
> sys.path[:] = self.syspath
> sys.modules.clear()
> sys.modules.update(self.sysmodules)
> del self.sysmodules
> cleanout(self.root)
>
> Or I could use the paranoid approach: create set from sys.modules.keys()
> in setUp + tearDown and remove the items that are in the second set but
> not in the first set.
>
>
> __
> Tracker <[EMAIL PROTECTED]>
> 
> __
>

__
Tracker <[EMAIL PROTECTED]>

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



[issue1426] readline module needs a review

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Done

just the on_completion_match_display_hook was in a bad state. The rest
was fine except for some indentions.

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



[issue1704621] interpreter crash when multiplying large lists

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Fixed in 2.5 branch (to be released with 2.5.2). Unit test added to 2.6
(trunk).

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't understand. When does the difference matter?

On Nov 12, 2007 10:14 AM, Christian Heimes <[EMAIL PROTECTED]> wrote:
>
> Christian Heimes added the comment:
>
> W/o the closed flag it's impossible to distinguish between closed fd and
> invalid fd.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Guido van Rossum wrote:
> Guido van Rossum added the comment:
> 
> I don't understand. When does the difference matter?

When the check for fd < 0 is removed from fileio_init() there is no way
to tell if fd < 0 means fd closed or invalid fd.

In order to fix the problem with GUI apps on Windows the check for fd <
0 has to be removed (Python 2.x way). Or we use Amaury's way and open
NUL for reading and writing as a substitute for the standard streams.

Christian

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

> > I don't understand. When does the difference matter?
>
> When the check for fd < 0 is removed from fileio_init() there is no way
> to tell if fd < 0 means fd closed or invalid fd.

I still don't understand. Why do you need to treat a closed fd
different from an invalid fd. In both cases you can't use it and you
shouldn't close it.

> In order to fix the problem with GUI apps on Windows the check for fd <
> 0 has to be removed (Python 2.x way). Or we use Amaury's way and open
> NUL for reading and writing as a substitute for the standard streams.

I'd suggest that, on Windows, sys.std{in,out.err} should be set to
None instead of a file object when their file descriptor is invalid.
That way print and write requests will fail immediately instead of
nondeterministically. With an invalid file that only blows upwhen
trying to flush you may be able to write a small traceback but it will
still blow up if the traceback is big.

Is there a downside to print/write blowing up right away in apps using pythonw?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Guido van Rossum wrote:
> I still don't understand. Why do you need to treat a closed fd
> different from an invalid fd. In both cases you can't use it and you
> shouldn't close it.

I don't want to treat the fd differently. I want to return a sensible
error message that is different from "file closed" when the fd is invalid.

> I'd suggest that, on Windows, sys.std{in,out.err} should be set to
> None instead of a file object when their file descriptor is invalid.
> That way print and write requests will fail immediately instead of
> nondeterministically. With an invalid file that only blows upwhen
> trying to flush you may be able to write a small traceback but it will
> still blow up if the traceback is big.

But wouldn't that cause a fatal error when sys.stderr is missing and
Python can't write the traceback to a file like object?

*testing*

No, it works:

object  : Exception('msg',)
type: Exception
refcount: 4
address : 0x839d274
lost sys.stderr

I've an alternative solution based on Amaurgy's idea. Python could set
replacements for stdin, stdout and stderr before it sets up the
preliminary stderr:

#ifdef MS_WINDOWS
/* The standard streams of Windows GUI apps aren't connected. */
if (fileno(stdin) < 0) {
if (freopen("NUL", "rb", stdin) == NULL)
Py_FatalError("Py_Initialize: failed to replace stdin");
}
if (fileno(stdout) < 0) {
if (freopen("NUL", "wb", stdout) == NULL)
Py_FatalError("Py_Initialize: failed to replace 
stdout");
}
if (fileno(stderr) < 0) {
if (freopen("NUL", "wb", stderr) == NULL)
Py_FatalError("Py_Initialize: failed to replace 
stderr");
}
#endif

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

The mail gateway swallows examples:

>>> import sys
>>> sys.stderr = None
>>> raise Exception("msg")
>>> del sys.stderr
>>> raise Exception("msg")
object  : Exception('msg',)
type: Exception
refcount: 4
address : 0x839d274
lost sys.stderr

__
Tracker <[EMAIL PROTECTED]>

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



[issue1210] imaplib does not run under Python 3

2007-11-12 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

Index: Lib/imaplib.py
===
--- Lib/imaplib.py  (revision 58956)
+++ Lib/imaplib.py  (working copy)
@@ -228,7 +228,7 @@
 self.port = port
 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 self.sock.connect((host, port))
-self.file = self.sock.makefile('rb')
+self.file = self.sock.makefile('r', encoding='ASCII', newline='')
 
 
 def read(self, size):

-

This patch fixes the issue but I am not entirely sure that it is
correct. I quickly looked at IMAP RFC and there does seem to be spec for
CHARSET in which case, that will have to be used instead of ASCII. It
requires more research and imap knowledge which I can't claim.

As for the tests, we need a imap server to connect to. Perhaps, google
wouldn't mind being used for this purpose?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

> I don't want to treat the fd differently. I want to return a sensible
> error message that is different from "file closed" when the fd is invalid.

Doesn't sound too important.  Anyway, from which call do you want to
issue different messages?

I'd rather see sys.stdout == None than opening NUL.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1431] pth files not loaded at startup

2007-11-12 Thread Giambattista Bloisi

New submission from Giambattista Bloisi:

site.py ha two limitations that make difficult to use pth files on my
linux installation (gobolinux):
- it does not process pth files that are located in directories that are
already present in os.path at the time the main method is invoked
- it does not process directory recursively

Please find attached a patch that solves both. Basically known_paths
became a set representing the directories that have been processed.
Duplicates in os.path are avoided by looking directly into it.

--
components: Library (Lib)
files: site.py.patch
messages: 57432
nosy: gbloisi
severity: normal
status: open
title: pth files not loaded at startup
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file8739/site.py.patch

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1265] pdb bug with "with" statement

2007-11-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Corrected by revision 58958.
"with" is innocent. The problem is this function in abc.py which uses a
generator expression:

def __instancecheck__(cls, instance):
"""Override for isinstance(instance, cls)."""
return any(cls.__subclasscheck__(c)
   for c in {instance.__class__, type(instance)})

It is called both by pdb (deep inside 'print') and the debugged code (in
PyObject_MethodCall), and this reveals the bug.

--
nosy: +amaury.forgeotdarc

__
Tracker <[EMAIL PROTECTED]>

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



[issue1432] Strange behavior of urlparse.urljoin

2007-11-12 Thread yan

New submission from yan:

When I use python 2.4/2.5, I found a strange behavior like this:
urlparse.urljoin("http://www.python.org/[EMAIL PROTECTED]","[EMAIL PROTECTED]")
It will return "http://www.python.org/[EMAIL PROTECTED]".  But I think it
should be "http://www.python.org/[EMAIL PROTECTED]", right? And I
test it in python 2.3. The result is what I supposed it to be.

--
components: Library (Lib)
messages: 57434
nosy: yan
severity: normal
status: open
title: Strange behavior of urlparse.urljoin
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue1265] pdb bug with "with" statement

2007-11-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

__instancecheck__ should be simpler: all classes are new-style, how is
it possible to have different results for
   instance.__class__
and
   type(instance)
?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1265] pdb bug with "with" statement

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Good work Amaury! :)

I also wonder how type(cls) != cls.__class__ is possible with new style
classes. So far I found only one way and it ain't beautiful:

>>> class Meta(type):
... def __getattribute__(self, key):
... if key == "__class__": return object
... return type.__getattribute__(self, key)
...
>>> class Example(metaclass=Meta): pass
...
>>> Example.__class__

>>> type(Example)


--
keywords: +py3k
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



[issue1415] py3k: pythonw.exe fails because std streams a missing

2007-11-12 Thread Christian Heimes

Christian Heimes added the comment:

Fixed in r58959

I followed your wish and set sys.stdin, stdout and stderr to None
together with __std?__. I also kept the check for fd < 0 in
fileio_init(). A negative fd still raises the correct error with errno 9
(bad file descriptor).

--
resolution:  -> fixed

__
Tracker <[EMAIL PROTECTED]>

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



[issue1265] pdb bug with "with" statement

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Good work indeed!

Here's another way:

>>> class C:
...   @property
...   def __class__(self): return D
... 
>>> class D: pass
... 
>>> C().__class__

>>>

__
Tracker <[EMAIL PROTECTED]>

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



[issue1265] pdb bug with "with" statement

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

BTW: if you can show (e.g. with your unittest) that this indeed breaks
in 2.6 and 2.5, please do backport it.

BTW**2: I've noticed that abc.py's __instancecheck__ gets called a lot
at times when I don't expect it.  Can you research this a bit?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1265] pdb bug with "with" statement

2007-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

PPSS. When backporting, a note in Misc/NEWS is appreciated.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1431] pth files not loaded at startup

2007-11-12 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
keywords: +patch

__
Tracker <[EMAIL PROTECTED]>

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