[issue1308] unicode(None) anomaly

2007-10-22 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Ok. This is not a bug, but by design. unicode(X)==unicode(str(X)) for
most things, and str(X)==repr(X) for most things. repr(None)=='None',
hence the result you see. Closing as invalid.

P.S. To respond via email, you have to add your email address to Your
Details (you need to add all email addresses you want to use as From
addresses).

--
resolution:  - invalid
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1308
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1309] windows build fix

2007-10-22 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
keywords: +patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1309
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1308] unicode(None) anomaly

2007-10-22 Thread James G. sack (jim)

James G. sack (jim) added the comment:

Martin v. Löwis wrote:
 Martin v. Löwis added the comment:
 
 Ok. This is not a bug, but by design. unicode(X)==unicode(str(X)) for
 most things, and str(X)==repr(X) for most things. repr(None)=='None',
 hence the result you see. Closing as invalid.
 
 P.S. To respond via email, you have to add your email address to Your
 Details (you need to add all email addresses you want to use as From
 addresses).
 
 --
 resolution:  - invalid
 status: open - closed
 
 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1308
 __
 

OK, thanks Martin.

Now that I think about it, I do understand.

My difficulty (and source of my surprise) was in mistakenly thinking of
unicode() as performing a string translation operation (that is, an
operation on strings).

I would now say that it is better thought of as a representation
function quite parallel to the str() function.

With that mindset, there is no surprise.

Thanks again, for your prompt attention and useful replies.

Regards,
..jim

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1308
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1263] PEP 3137 patch - str8/str comparison should return false

2007-10-22 Thread Brett Cannon

Changes by Brett Cannon:


--
keywords: +py3k
priority:  - immediate
type: rfe - behavior

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1263
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1286] fileinput, StringIO, and cStringIO do not support the with protocol

2007-10-22 Thread Yitz Gale

Yitz Gale added the comment:

These objects are supposed to be drop-in replacements
for file handles. Except in legacy code, the way you
use a file handle is:

with function_to_create_fh as fh:
  do stuff

If these objects do not support the with protocol,
the only way to use them is to refactor this code.
That may not even be possible, e.g., if it is in
a library, or it may not be desirable to refactor.

Even if you can refactor it, I don't think you
can call these objects file-like objects if
you can't use them like a file.

Note that in legacy code, you used to write:

fh = function_to_get_fh
try:
  do stuff
finally:
  fh.close()

If function_to_get_fh happens to return some other
file-like object and not an actual file,
this still works fine without any refactoring.

You wrote:
 In Py3k, I don't think adding support
 for the 'with' statement to StringIO makes
 any sense, since the close()
 method does nothing.

So do you propse removing the close() method
altogether? Of course the answer is no,
because then you could not use the object like
a file. The same is true for the with protocol.

(I now retract the words that needs to be closed
from my original comment. All file-like objects
should support the with protocol, regardles of
whether their close() method actually does anything.)

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1286
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1311] os.path.exists(os.devnul) regression on windows

2007-10-22 Thread David Kågedal

New submission from David Kågedal:

When moving from Python 2.4 to Python 2.5, my program stopped working on
win32 because of a change in os.path.exists. I couldn't find any
description of the change, so I can only assume it's a bug.

The os.devnul variable contains the name of the null file, which is
/dev/null on posix, and nul on win32. As I understand it, NUL is a
file that exists in every directory on win32.

Opening the nul file with open(nul, r) works fine, but
os.path.exists(nul) returns False. In Python 2.4, it returns True.

--
components: Library (Lib)
messages: 56644
nosy: d_kagedal
severity: normal
status: open
title: os.path.exists(os.devnul) regression on windows
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1311
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1311] os.path.exists(os.devnull) regression on windows

2007-10-22 Thread David Kågedal

David Kågedal added the comment:

It's called os.devnull, and nothing else.

--
title: os.path.exists(os.devnul) regression on windows - 
os.path.exists(os.devnull) regression on windows

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1311
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1310] tempfile breaks on Windows

2007-10-22 Thread Georg Brandl

Georg Brandl added the comment:

Fixed in r58590.

--
nosy: +georg.brandl
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1310
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1298] Support for z/OS and EBCDIC.

2007-10-22 Thread Lauri Alanko

Lauri Alanko added the comment:

Further comments on the port can be at:
http://mail.python.org/pipermail/python-dev/2007-October/074991.html

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1298
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1309] windows build fix

2007-10-22 Thread Guido van Rossum

Guido van Rossum added the comment:

Committed revision 58592.

--
nosy: +gvanrossum
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1309
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1307] smtpd.SMTPServer throws exception on MAIL command with no arg

2007-10-22 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks!

Committed revision 58594.

Is there time to backport this to 2.5.2?

--
assignee:  - nnorwitz
nosy: +gvanrossum, nnorwitz
resolution:  - accepted

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1307
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1304] py3k compilation on Windows

2007-10-22 Thread Guido van Rossum

Guido van Rossum added the comment:

This doesn't apply cleanly with today's trunk, and that's not just due
to the fix by Christian Heimes (which I checked in before noticing this)
that fixes the same issue (bytes_methods.c).

Can you  Christian please work together on a new patch?  I don't have
Windows access but I will check it in if it applies cleanly.

--
keywords: +patch
nosy: +gvanrossum

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1304
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1305] socket.py hangs on Mac OS X

2007-10-22 Thread Guido van Rossum

Guido van Rossum added the comment:

Odd.  Smells like an OSX issue that we can't do anything about.  I note
that only attempts 250, 500, 750 (and so on if you increase the counter)
have this behavior.  I wonder if you'r simply filling up some kernel
queue too fast; if I insert time.sleep(0.001) in the for loop it won't
happen.

--
nosy: +gvanrossum
resolution:  - wont fix
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1305
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1311] os.path.exists(os.devnull) regression on windows

2007-10-22 Thread Facundo Batista

Facundo Batista added the comment:

You migrated only of Python version, or also of windows installation?

I checked Py25 and Py23 in my Win 2k, and in both I have the same behaviour:

C:\Python23python
Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on
win32
Type help, copyright, credits or license for more information.
 import os
 os.stat(nul)
Traceback (most recent call last):
  File stdin, line 1, in ?
OSError: [Errno 22] Invalid argument: 'nul'
 os.path.exists(nul)
False


I checked the os.stat() function because the documentation says that if
it gives an error, exists() will return False (and that this is how it's
implemented).

BTW, note that if you call to the GetFileAttributesEx() function of
kernel32.dll by yourself, it will give error for the NUL file, showing
that it actually does not exist.

Because of this, I'd say that current behaviour of os.exists() is ok,
but I want to know the answer of my question regarding your change
before closing this as not-a-bug.

Thanks!

--
nosy: +facundobatista

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1311
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1253] IDLE - Percolator overhaul

2007-10-22 Thread Kurt B. Kaiser

Kurt B. Kaiser added the comment:

What change was required to allow Squeezer and ShellLogger
to co-exist?

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1253
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1307] smtpd.SMTPServer throws exception on MAIL command with no arg

2007-10-22 Thread Neal Norwitz

Neal Norwitz added the comment:

It would be great to get this into 2.5.2.

--
assignee: nnorwitz - gvanrossum

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1307
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1312] doctest EXCEPTION_RE can't handle preceding output

2007-10-22 Thread Daniel Nouri

New submission from Daniel Nouri:

doctest.DocTestParser._EXCEPTION_RE does not allow for output before the
actual traceback.

Attached is a simple test that demonstrates the problem.  This patch
fixes it:

--- /usr/lib/python2.5/doctest.py 2007-10-22 21:45:21.0 +0200
+++ /home/daniel/tmp/doctest.py   2007-10-22 22:19:12.0 +0200
@@ -513,7 +513,7 @@
 _EXCEPTION_RE = re.compile(r
 # Grab the traceback header.  Different versions of Python have
 # said different things on the first traceback line.
-^(?Phdr Traceback\ \(
+.*^(?Phdr Traceback\ \(
 (?: most\ recent\ call\ last
 |   innermost\ last
 ) \) :


_EXCEPTION_RE = re.compile(r
# Grab the traceback header.  Different versions of Python have
# said different things on the first traceback line.
^(?Phdr Traceback\ \(
(?: most\ recent\ call\ last
|   innermost\ last
) \) :
)
\s* $# toss trailing whitespace on the header.
(?Pstack .*?)  # don't blink: absorb stuff until...
^ (?Pmsg \w+ .*)   # a line *starts* with alphanum.
, re.VERBOSE | re.MULTILINE | re.DOTALL)

--
components: Library (Lib)
files: doctest-bug.py
messages: 56655
nosy: nouri
severity: normal
status: open
title: doctest EXCEPTION_RE can't handle preceding output
versions: Python 2.5
Added file: http://bugs.python.org/file8591/doctest-bug.py

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1312
__def f():

   f() # doctest: +ELLIPSIS
  Hello, World!
  Traceback (most recent call last):
  ...
  ValueError: foo

print Hello, World!
raise ValueError(foo)

def _test():
import doctest
doctest.testmod()

if __name__ == __main__:
_test()
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1263] PEP 3137 patch - str8/str comparison should return false

2007-10-22 Thread Brett Cannon

Brett Cannon added the comment:

Everything committed in r58596.  Thanks for the help, Thomas!

--
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1263
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1312] doctest EXCEPTION_RE can't handle preceding output

2007-10-22 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
keywords: +patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1312
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1313] Typo in Python Library Reference documentation: logging module

2007-10-22 Thread Nathan Haines

New submission from Nathan Haines:

In the Python Library Reference manual, in section 14.5 (logging), there
is a typo in the debug function example code.  In the 2.5 PDF this is on
page 446.

The last line reads:
logging.warning(Protocol problem: %s, connection reset, extra=d)

This should read:
logging.warning(Protocol problem: %s, connection reset, extra=dict)

This error persists in the 2.6 and 3.0 documentation.

--
components: Documentation
messages: 56658
nosy: nhaines
severity: normal
status: open
title: Typo in Python Library Reference documentation: logging module
versions: Python 2.5, Python 2.6, Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1313
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1304] py3k compilation on Windows

2007-10-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

I generated the file with svn diff, on Windows.
Is it a line ending issue in the diff file? Many text files have the
svn:eol-style=native property, but the PCBuild8/*/*.vcproj don't.

I upload a new version of the patch, with all line endings converted to
Unix mode. It should match your local copy.

Added file: http://bugs.python.org/file8593/win32build.2.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1304
__

win32build.2.diff
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1304] py3k compilation on Windows

2007-10-22 Thread Guido van Rossum

Guido van Rossum added the comment:

Yup, I think that was it.  Sorry.

Committed revision 58597.

--
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1304
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue708374] add offset to mmap

2007-10-22 Thread Guido van Rossum

Guido van Rossum added the comment:

Fine with me!

--
nosy: +gvanrossum


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue708374

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



[issue1303] adapt str8 constructor to bytes constructor

2007-10-22 Thread Brett Cannon

Brett Cannon added the comment:

The changes to str8 look fine.

Now it's time to find out how badly tests break since Georg's patch was
generated.  =)

--
assignee: gvanrossum - brett.cannon

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1303
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue708374] add offset to mmap

2007-10-22 Thread Travis Oliphant

Travis Oliphant added the comment:

I applied phuang's patch in revision 58598. This can be closed.


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue708374

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



[issue1307] smtpd.SMTPServer throws exception on MAIL command with no arg

2007-10-22 Thread Neal Norwitz

Neal Norwitz added the comment:

Thanks for the patch.

Committed revision 58599. (2.5)

--
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1307
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com