[issue6215] Backport the IO lib to trunk

2009-06-14 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I think I could fix windows build issue. (r73423)

It seems some tests are failing. See
http://www.python.org/dev/buildbot/trunk.stable/x86%20XP-4%20trunk/builds/2244/step-test/0

--
nosy: +ocean-city

___
Python tracker 

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



[issue6215] Backport the IO lib to trunk

2009-06-14 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I found following patch can fix test_invalid_operations error on
windows. Is this correct fix? There are many other places using bare open().

Index: Lib/test/test_io.py
===
--- Lib/test/test_io.py (revision 73422)
+++ Lib/test/test_io.py (working copy)
@@ -298,13 +298,13 @@
 def test_invalid_operations(self):
 # Try writing on a file opened in read mode and vice-versa.
 for mode in ("w", "wb"):
-with open(support.TESTFN, mode) as fp:
+with self.open(support.TESTFN, mode) as fp:
 self.assertRaises(IOError, fp.read)
 self.assertRaises(IOError, fp.readline)
-with open(support.TESTFN, "rb") as fp:
+with self.open(support.TESTFN, "rb") as fp:
 self.assertRaises(IOError, fp.write, b"blah")
 self.assertRaises(IOError, fp.writelines, [b"blah\n"])
-with open(support.TESTFN, "r") as fp:
+with self.open(support.TESTFN, "r") as fp:
 self.assertRaises(IOError, fp.write, "blah")
 self.assertRaises(IOError, fp.writelines, ["blah\n"])

--

___
Python tracker 

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



[issue6281] Bug in hashlib

2009-06-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can you propose an actual test case and a patch?

--
nosy: +pitrou

___
Python tracker 

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



[issue6282] In tarfile, compression level cannot be specified

2009-06-14 Thread Omri Shaked

New submission from Omri Shaked :

When creating a TarFile object that uses compression, the compressor is
always created using its default compression level.

import bz2
self.cmp = bz2.BZ2Compressor()

You can't specify the compression level (i.e. self.cmp =
bz2.BZ2Compressor(1)).

--
components: Library (Lib)
messages: 89345
nosy: Tzigi
severity: normal
status: open
title: In tarfile, compression level cannot be specified
type: feature request
versions: Python 2.6

___
Python tracker 

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



[issue6279] datamodel documentation confuses staticmethod with classmethod

2009-06-14 Thread Florian Mayer

Florian Mayer  added the comment:

Sorry, my fault.

--
status: open -> closed

___
Python tracker 

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



[issue6279] datamodel documentation confuses staticmethod with classmethod

2009-06-14 Thread Florian Mayer

Changes by Florian Mayer :


Removed file: http://bugs.python.org/file14292/datamodel.rst.patch

___
Python tracker 

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



[issue6205] sdist doesn't include data_files

2009-06-14 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Hi James, this has been changed already for trunk and 3.x, see #2279.

Although it hasn't been backported in Python 2.6.x because it's a major
behavior change that breaks setuptools.

Although, when 2.7 and 3.2 are out, we will provide a backport of
distutils. for 2.6 and 2.5.

until then you do have to declare your files in the MANIFEST.in template

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue6283] Cannot build extension in amd64 using msvc9compiler

2009-06-14 Thread Alex Shih-Han Lin

New submission from Alex Shih-Han Lin :

OS is Windows 7 x64, python using 2.6.2 amd64, SDK installed, but when I
build some module by setup.py, it always traceback ValueError.

running build
running build_py
running build_ext
building 'genshi._speedups' extension
Traceback (most recent call last):
  File "C:\Genshi-0.5.1\setup.py", line 116, in 
'build_ext': optional_build_ext}
  File "C:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
  File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
  File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
  File "C:\Python26\lib\distutils\command\build.py", line 134, in run
self.run_command(cmd_name)
  File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
  File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
  File "C:\Genshi-0.5.1\setup.py", line 39, in run
build_ext.run(self)
  File "C:\Python26\lib\distutils\command\build_ext.py", line 345, in run
self.build_extensions()
  File "C:\Python26\lib\distutils\command\build_ext.py", line 471, in
build_extensions
self.build_extension(ext)
  File "C:\Genshi-0.5.1\setup.py", line 45, in build_extension
build_ext.build_extension(self, ext)
  File "C:\Python26\lib\distutils\command\build_ext.py", line 536, in
build_extension
depends=ext.depends)
  File "C:\Python26\lib\distutils\msvc9compiler.py", line 448, in compile
self.initialize()
  File "C:\Python26\lib\distutils\msvc9compiler.py", line 358, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
  File "C:\Python26\lib\distutils\msvc9compiler.py", line 274, in
query_vcvarsall
raise ValueError(str(list(result.keys(
ValueError: [u'path']

I printed out the variables "result", it only had key 'path'.

--
components: Library (Lib)
messages: 89348
nosy: alexsh
severity: normal
status: open
title: Cannot build extension in amd64 using msvc9compiler
type: compile error
versions: Python 2.6

___
Python tracker 

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



[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-14 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I updated the documentation in r73429. Is that better?

--
versions: +Python 3.2 -Python 3.0

___
Python tracker 

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



[issue6283] Cannot build extension in amd64 using msvc9compiler

2009-06-14 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Do you have VS2008 installed also?

--
nosy: +loewis

___
Python tracker 

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



[issue6275] let unittest.assertRaises() return the exception object caught

2009-06-14 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Guido's comment is out of date.  The assertRaises(exception) already 
returns something:  A context manager.

If we don't want to return the object, how about retainig it in the 
context manager, then?
It is very awkward otherwise to make any kinds of assertions on the thrown 
exceptions.  Using the Regexp variant is rather half-assed.

--
status: closed -> open

___
Python tracker 

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



[issue6275] let unittest.assertRaises() return the exception object caught

2009-06-14 Thread Michael Foord

Michael Foord  added the comment:

Well, his comment was made after assertRaises had already been made a
context manager. 

Keeping the exception attached to the context manager is an interesting
suggestion and a less 'surprising' change to the API.

--

___
Python tracker 

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



[issue6275] let unittest.assertRaises() return the exception object caught

2009-06-14 Thread Michael Foord

Michael Foord  added the comment:

I disagree that the regex version is half-assed though. If all you want
to do is to make assertions about the exception message (the most common
use case in *my* experience) it is enormously convenient.

--

___
Python tracker 

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



[issue1399935] enhance unittest to define tests that *should* fail

2009-06-14 Thread Michael Foord

Michael Foord  added the comment:

Patch needs updating but still seems like a useful feature. I'll update
and commit. I agree that decorator should be lowercase - should_fail or
shouldfail ?

--

___
Python tracker 

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



[issue6281] Bug in hashlib

2009-06-14 Thread Daniel Eloff

Daniel Eloff  added the comment:

If you're missing any hash algorithm from openssl (say sha224) and the
corresponding _sha224 module, hashlib will fail to import and no hash
algorithms will be available.

Additionally, if no (or only some) openssl algorithms are available, the
error branch expects every hash algorithm to be present in it's own
module, if even one is missing, hashlib will fail to import.

Producing a test case for these without mock objects is difficult at
best. I leave that to the python team, if they desire to do so.

Here is a rewritten hashlib.py, without that ugly mess of code and
without the above two bugs. It passes all tests.

--
Added file: http://bugs.python.org/file14297/hashlib.py

___
Python tracker 

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



[issue6275] let unittest.assertRaises() return the exception object caught

2009-06-14 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Uploading a slimmed down patch, with only the exc_value memeber added to 
the assertRaises context manager.

--
Added file: http://bugs.python.org/file14298/unitest2.patch

___
Python tracker 

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



[issue6284] C/API PyErr_AsUnicode()

2009-06-14 Thread Campbell Barton

New submission from Campbell Barton :

This function returns the output of PyErr_Print as a unicode string.

We needed this in Blender3D because it has its own error logging system
which does not use the console.

The patch is made against python3k r73429.

--
components: None
files: PyErr_AsUnicode_r73429.diff
keywords: patch
messages: 89357
nosy: ideasman42
severity: normal
status: open
title: C/API PyErr_AsUnicode()
versions: Python 3.1
Added file: http://bugs.python.org/file14299/PyErr_AsUnicode_r73429.diff

___
Python tracker 

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



[issue6281] Bug in hashlib

2009-06-14 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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

___
Python tracker 

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



[issue6284] C/API PyErr_AsUnicode()

2009-06-14 Thread Campbell Barton

Campbell Barton  added the comment:

last patch was bad heres a new one.

--
Added file: http://bugs.python.org/file14300/PyErr_AsUnicode_r73429.diff

___
Python tracker 

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




[issue6284] C/API PyErr_AsUnicode()

2009-06-14 Thread Campbell Barton

Changes by Campbell Barton :


Removed file: http://bugs.python.org/file14299/PyErr_AsUnicode_r73429.diff

___
Python tracker 

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



[issue1399935] enhance unittest to define tests that *should* fail

2009-06-14 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Actually, unittest already has @expectedFailure.

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

___
Python tracker 

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



[issue6284] C/API PyErr_AsUnicode()

2009-06-14 Thread Campbell Barton

Changes by Campbell Barton :


Removed file: http://bugs.python.org/file14300/PyErr_AsUnicode_r73429.diff

___
Python tracker 

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



[issue6284] C/API PyErr_AsUnicode()

2009-06-14 Thread Campbell Barton

Changes by Campbell Barton :


Added file: http://bugs.python.org/file14301/PyErr_AsUnicode_r73429.diff

___
Python tracker 

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



[issue6281] Bug in hashlib

2009-06-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> patch review
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue6208] path separator output ignores shell's path separator: / instead of \

2009-06-14 Thread ThurnerRupert

ThurnerRupert  added the comment:

the parent process would be "sh.exe" in the msys case, contrary to the 
windows standard cmd.exe, explorer.exe, system, system idle 
process, ...

an example is the mercurial "status" command, see 
http://selenic.com/repo/index.cgi/hg/file/8bf6eb68ddaf/mercurial/comman
ds.py#l2752

which uses 
http://selenic.com/repo/index.cgi/hg/file/8bf6eb68ddaf/mercurial/util.p
y#l210 (pathto, ), and normpath = os.path.normcase(path).

which does at the end:
 sys.stdout.write(str(a))

when string the string goes out on stdout or stderr it is not known 
any more it was a file path. hmm.

--

___
Python tracker 

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



[issue6215] Backport the IO lib to trunk

2009-06-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I found following patch can fix test_invalid_operations error on
> windows. Is this correct fix? There are many other places using bare open().

The fix looks ok. 
test_io should use self.open() instead of open() everywhere, except in
places where it's not used as a test.

--

___
Python tracker 

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



[issue4388] test_cmd_line fails on MacOS X

2009-06-14 Thread Jean Brouwers

Jean Brouwers  added the comment:

This test still fails and is the only failure with Python 3.1rc2 on MacOS 
X 10.4.11 Tiger (Intel).

--

___
Python tracker 

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



[issue1252236] Simplying Tkinter's event loop

2009-06-14 Thread Guilherme Polo

Guilherme Polo  added the comment:

Michiel, the patch on #1049855 has been rejected so there is no longer a
fix for the first problem to be solved.
Also, the fourth problem you described is not entirely true, it is
possible to run tkinter apps on IDLE without calling the mainloop
function (see #989712). It is possible that this wasn't the case 4 years
ago, I don't know, just pointing out the current situation.

I also don't understand how just moving event handling to Python will
solve the problems. But maybe it could be good to add an option that
would prevent calling EnableEventHook in _tkinter after loading tk, so
the user could handle tk events and what not the way he whises.

Is there anyone still interested on this ? Please ?

--

___
Python tracker 

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



[issue3407] test_urllib2_localnet fails on MacOS X 10.4.11 (Intel)

2009-06-14 Thread Jean Brouwers

Jean Brouwers  added the comment:

This test passes with Python 3.1rc2 on MacOS X 10.4.11 Tiger (Intel).

% ./python.exe
Python 3.1rc2 (r31rc2:73411, Jun 14 2009, 09:27:12) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D

% ./python.exe Lib/test/test_urllib2_localnet.py
test_proxy_qop_auth_int_works_or_throws_urlerror 
(__main__.ProxyAuthTests) ... ok
test_proxy_qop_auth_works (__main__.ProxyAuthTests) ... ok
test_proxy_with_bad_password_raises_httperror (__main__.ProxyAuthTests) 
... ok
test_proxy_with_no_password_raises_httperror (__main__.ProxyAuthTests) 
... ok
test_200 (__main__.TestUrlopen) ... ok
test_200_with_parameters (__main__.TestUrlopen) ... ok
test_404 (__main__.TestUrlopen) ... ok
test_bad_address (__main__.TestUrlopen) ... ok
test_basic (__main__.TestUrlopen) ... ok
test_chunked (__main__.TestUrlopen) ... ok
test_geturl (__main__.TestUrlopen) ... ok
test_info (__main__.TestUrlopen) ... ok
test_redirection (__main__.TestUrlopen) ... ok
test_sending_headers (__main__.TestUrlopen) ... ok

--
Ran 14 tests in 10.202s

OK

--

___
Python tracker 

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



[issue3407] test_urllib2_localnet fails on MacOS X 10.4.11 (Intel)

2009-06-14 Thread Jean Brouwers

Jean Brouwers  added the comment:

The test also passes on Python 2.6.2 on MacOS X 10.4.11 Tiger (Intel):

% ./python.exe
Python 2.6.2 (r262:71600, Apr 15 2009, 21:47:16) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D

% ./python.exe Lib/test/test_urllib2_localnet.py
test_proxy_qop_auth_int_works_or_throws_urlerror (__main__.ProxyAuthTests) ... 
ok
test_proxy_qop_auth_works (__main__.ProxyAuthTests) ... ok
test_proxy_with_bad_password_raises_httperror (__main__.ProxyAuthTests) ... ok
test_proxy_with_no_password_raises_httperror (__main__.ProxyAuthTests) ... ok

--
Ran 4 tests in 4.233s

OK
test_200 (__main__.TestUrlopen) ... ok
test_200_with_parameters (__main__.TestUrlopen) ... ok
test_404 (__main__.TestUrlopen) ... ok
test_bad_address (__main__.TestUrlopen) ... ok
test_basic (__main__.TestUrlopen) ... ok
test_geturl (__main__.TestUrlopen) ... ok
test_info (__main__.TestUrlopen) ... ok
test_redirection (__main__.TestUrlopen) ... ok
test_sending_headers (__main__.TestUrlopen) ... ok

--
Ran 9 tests in 8.954s

OK

--

___
Python tracker 

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



[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Rather than "only a single read on the raw stream", it should be "at
most a single read on the raw stream", IMHO.

--

___
Python tracker 

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



[issue6275] let unittest.assertRaises() return the exception object caught

2009-06-14 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Ok, maybe a bad choice of words :)
I don't write unittests that much, of course, but I have found that when I 
am writing tests for stuff such as http, I want to verify the actual error 
code, i.e. HTTPError.code, which is not possible using the message alone.
Same goes for e.g. socket.error

--

___
Python tracker 

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



[issue5492] Error on leaving IDLE with quit() or exit() under Linux

2009-06-14 Thread Guilherme Polo

Guilherme Polo  added the comment:

I can get a similar error from time to time, just try it a couple of
times and I believe you should hit it too.

When that error isn't thrown IDLE prints the traceback of a SystemExit
exception inside IDLE right before closing, so it may be hard to notice.

The error I am able to get (using 3.1rc2+ r73431):


*** Internal Error: rpc.py:SocketIO.localcall()

 Object: stderr 
 Method: > 
 Args: ('SystemExit: None\n',)

Traceback (most recent call last):
  File "/home/gpolo/python-dev/py3k/Lib/idlelib/rpc.py", line 188, in
localcall
ret = method(*args, **kwargs)
  File "/home/gpolo/python-dev/py3k/Lib/idlelib/PyShell.py", line 1231,
in write
self.shell.write(s, self.tags)
  File "/home/gpolo/python-dev/py3k/Lib/idlelib/PyShell.py", line 1214,
in write
self.text.mark_gravity("iomark", "left")
AttributeError: 'NoneType' object has no attribute 'mark_gravity'


I'm not sure if it can't happen in python-trunk too, I see it throws an
exception when leaving IDLE but till now I never got an error message
after IDLE (almost) exited.

--

___
Python tracker 

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



[issue1230] Tix HList class missing method implementation for info_bbox

2009-06-14 Thread Guilherme Polo

Guilherme Polo  added the comment:

Please include a diff of this modified Tix.py instead.

--
nosy: +gpolo

___
Python tracker 

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



[issue6227] doctest_aliases doesn't test duplicate removal

2009-06-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Fixed in r73432 (trunk), will be merged to py3k after 3.1 is final.
Thanks for the report!

--
nosy: +amaury.forgeotdarc
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue5221] help related topic doesn't exist

2009-06-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

In 3.1rc2, SPECIALMETHODS help ends with
"Related help topics: BASICMETHODS, ATTRIBUTEMETHODS, CALLABLEMETHODS,
SEQUENCEMETHODS1, MAPPINGMETHODS, SEQUENCEMETHODS2, NUMBERMETHODS,
CLASSES".
The topic list only has SEQUENCEMETHODS and not S...1 and S...2.
So I suspect the two topics were consolidated into one without changing
the cross-reference lists.  The latter need editing.

--
keywords: +easy
nosy: +tjreedy
versions: +Python 3.1

___
Python tracker 

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



[issue6284] C/API PyErr_AsUnicode()

2009-06-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

PyErr_Print seems a too high-level function for this usage:
- it uses sys.excepthook
- it exits the process if the exception is SystemExit (!)

I'd prefer a function similar to PyErr_Display. And sys.stderr should 
not be redirected to a temporary stream: this change is not thread safe.
For example, A new function PyErr_DisplayEx could take an additional 
(PyObject *fp) argument.

As for the Blender use case: isn't it appropriate for Blender to change 
sys.stderr globally, since the console is not used?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue1489051] keyword and topic help broken in Pythonwin IDE

2009-06-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Something changed in the past year so that keyword and topic help work
in 3.2rc2 at both the main prompt and help prompt.  Thanks to whoever.
If this is also fixed in 2.6.2 or even 2.6 in SVN, this can be closed.

>>> help('while')
The ``while`` statement...
...
>>> help('ASSERTION')
The ``assert`` statement...
...
help> while
The ``while`` statement
...
help> ASSERTION
The ``assert`` statement

--
versions:  -Python 3.1

___
Python tracker 

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



[issue6281] Bug in hashlib

2009-06-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

In addition, I would replace
exec funcName + ' = __get_hash(funcName)'
with
globals()[funcName] = __get_hash(funcName)

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6281] Bug in hashlib

2009-06-14 Thread Daniel Eloff

Daniel Eloff  added the comment:

Yes, I prefer:

globals()[funcName] = __get_hash(funcName)

The exec was used in the original code, I'm not aware of the style of
the python stdlib programmers, so I tried to be as true to what I found
as possible.

I just wanted to blunt my words in the original post, I don't want
Gregory Smith to view it as a personal attack, I was just frustrated in
having to debug the hashlib code. I'm sure even Gregory would admit it's
not code he's proud of (probably done under a tight deadline.) No doubt
Gregory normally does high quality work.

--

___
Python tracker 

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



[issue6095] os.curdir as the default argument for os.listdir

2009-06-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Some comments about the patch:

- It seems wasteful to allocate a new PyUnicode object for the "."; the 
posix implements does it right: a simple wcscopy should be enough (and 
reduces the chances of refcount mistakes)

- the last block is not correctly indented; this code uses tabs.

- no need to test for hasattr(posix, 'listdir'): all supported platforms 
have directories and the posix module always exposes this function.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6095] os.curdir as the default argument for os.listdir

2009-06-14 Thread Virgil Dupras

Virgil Dupras  added the comment:

1. Yeah, I know. At first, that's what I wanted to do, but it resulted 
in a lot of code duplication (alloc, memerror, copy), which I didn't 
much like. But then again, what I ended up writing (because I realized I 
had to decref the  new "po") uses up more lines anyway...

2. oops

3. I did it because all other tests do it. I thought there had to be a 
reason (but then again, that old broken "lsdir" test had been there for 
a while...). Even if there's no reason. the new test would really stand 
out compared to the rest...

--

___
Python tracker 

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



[issue6285] Silent abort on XP help document display

2009-06-14 Thread Scott David Daniels

New submission from Scott David Daniels :

When running Idle on Windows XP, Python 3.1rc2, 
a failure to find an entry in the help documents causes Idle to exit
(with no visible indication of why).  The reason is in a failure of the
call to os.startfile, and apparenly the exception causes Idle to exit
silently.  Here is a patch to .../Lib/idlelib/EditorWindow.py:

@@ -436,20 +436,24 @@ class EditorWindow(object):
 def config_dialog(self, event=None):
 configDialog.ConfigDialog(self.top,'Settings')

 def help_dialog(self, event=None):

fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt')
 textView.view_file(self.top,'Help',fn)

 def python_docs(self, event=None):
-if sys.platform[:3] == 'win':
-os.startfile(self.help_url)
-else:
-webbrowser.open(self.help_url)
+try:
+if sys.platform[:3] == 'win':
+os.startfile(self.help_url)
+else:
+webbrowser.open(self.help_url)
+except EnvironmentError as why:
+tkMessageBox.showerror(title='Document Start Failure',
+   message=str(why), parent=self.text)
 return "break"

 def cut(self,event):
 self.text.event_generate("<>")
 return "break"

 def copy(self,event):
 if not self.text.tag_ranges("sel"):
@@ -741,20 +745,25 @@ class EditorWindow(object):
 # and update the menu dictionary
 self.menudict['help'] = helpmenu

 def __extra_help_callback(self, helpfile):
 "Create a callback with the helpfile value frozen at definition
time"
 def display_extra_help(helpfile=helpfile):
 if not helpfile.startswith(('www', 'http')):
 url = os.path.normpath(helpfile)
-if sys.platform[:3] == 'win':
-os.startfile(helpfile)
-else:
-webbrowser.open(helpfile)
+try:
+if sys.platform[:3] == 'win':
+os.startfile(helpfile)
+else:
+webbrowser.open(helpfile)
+except EnvironmentError as why:
+tkMessageBox.showerror(title='Document Start Failure',
+   message=str(why), parent=self.text)
+return "break"
 return display_extra_help

 def update_recent_files_list(self, new_file=None):
 "Load and update the recent files list and menus"
 rf_list = []
 if os.path.exists(self.recent_files_path):
 rf_list_file = open(self.recent_files_path,'r')
 try:

--
components: IDLE
messages: 89378
nosy: scott_daniels
severity: normal
status: open
title: Silent abort on XP help document display
versions: Python 3.1

___
Python tracker 

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



[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

2009-06-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Do you want to write a patch?
(Note: the time module is written in C)

--
nosy: +amaury.forgeotdarc
stage:  -> needs patch

___
Python tracker 

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



[issue6282] In tarfile, compression level cannot be specified

2009-06-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The TarFile.bz2open function does have a 'compresslevel' parameter.
How do you use TarFile?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6215] Backport the IO lib to trunk

2009-06-14 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Here is a patch to convert open() and io.open() to self.open().

# I didn't change _default_chunk_size() but maybe should this also use
self.open()?

--
Added file: http://bugs.python.org/file14302/self_open.patch

___
Python tracker 

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



[issue6215] Backport the IO lib to trunk

2009-06-14 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

> except in places where it's not used as a test.

I couldn't distinguish which one is that case, so I converted all
open(). ;-)

--

___
Python tracker 

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



[issue6283] Cannot build extension in amd64 using msvc9compiler

2009-06-14 Thread Alex Shih-Han Lin

Alex Shih-Han Lin  added the comment:

yes, I have already installed VS 2008 (but it is Express Edition for VC,
VB ,C#...I have no money to buy standard edition.)

--

___
Python tracker 

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



[issue6277] Add description of new syntax of with to 2.7 whatsnew document.

2009-06-14 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

AMK writes the whatsnew for 2.7 and I write it for 3.1.
In the case of 3.1, I already have an entry.

--
nosy: +rhettinger

___
Python tracker 

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



[issue6277] Add description of new syntax of with to 2.7 whatsnew document.

2009-06-14 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I should have been clearer.  There is no need to submit patches for
whatsnew documents.  Those are solely the responsiblity of their
individual maintainers (see the instructions at the top of the file).

--

___
Python tracker 

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



[issue1489051] keyword and topic help broken in Pythonwin IDE

2009-06-14 Thread Georg Brandl

Georg Brandl  added the comment:

Very good :)

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

___
Python tracker 

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



[issue6143] IDLE - an extension to clear the shell window

2009-06-14 Thread Roger Serwy

Roger Serwy  added the comment:

I just tried Squeezer. It's pretty neat and it solves a different
problem. Clearing the contents of the shell window should be a simple
operation.

The undo operation doesn't restore iomark properly, nor does it restore
tags. I've uploaded a newer version of the extension to handle undo.

Binding to the "<>" virtual event with add="+" didn't work as
expected, so the new undo event handler explicitly calls the older one.
I admit that this code is not ideal.

Should I move this extension to the Cheese Shop and close out this issue?

--
Added file: http://bugs.python.org/file14303/ClearWindow.py

___
Python tracker 

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



[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-14 Thread Lucas Prado Melo

Lucas Prado Melo  added the comment:

Here is a patch that passes all the tests (I had to change some of them
though, they were expecting erroneous behaviours IMHO).
The biggest problem was the read1 testing, I've tried to get the maximum
of bytes less than or equal to what the user wanted while executing at
most 1 raw_read()'s.

I have created a new test for peek()'ing a number of bytes bigger than
could possibly be stored on the buffer.

--
Added file: http://bugs.python.org/file14304/peek3.diff

___
Python tracker 

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



[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-14 Thread Lucas Prado Melo

Lucas Prado Melo  added the comment:

Here, it's a patch that passes all the tests (I had to change some of them
though, they were expecting erroneous behaviours IMHO).
The biggest problem was the read1 testing, I've tried to get the maximum
of bytes less than or equal to what the user wanted while executing at
most 1 raw_read()'s.

I have created a new test for peek()'ing a number of bytes bigger than
could possibly be stored on the buffer.

--

___
Python tracker 

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



[issue6285] Silent abort on XP help document display

2009-06-14 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

How exactly did you trigger the error that you are fixing?

--
nosy: +loewis

___
Python tracker 

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



[issue6285] Silent abort on XP help document display

2009-06-14 Thread Scott David Daniels

Scott David Daniels  added the comment:

I uninstalled 3.1rc1, installed 3.1rc2, was exercising, and went to look
up something in the docs, and Idle disappeared.  I tried again, same
result.  So I opened a command window, and ran Idle as:
 python -m idlelib.idle
Tried it again and got an error message that I chased down.
Figured out it was an oncovered exception, and 

--Scott David Daniels
scott.dani...@acm.org

--

___
Python tracker 

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



[issue6283] Cannot build extension in amd64 using msvc9compiler

2009-06-14 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

So when you run vcvarsall.bat, and then do "set", does it print any of
the variables "include", "lib", "libpath", "path"?

--

___
Python tracker 

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



[issue6285] Silent abort on XP help document display

2009-06-14 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> I uninstalled 3.1rc1, installed 3.1rc2, was exercising, and went to look
> up something in the docs

What does that mean? What exactly did you do to "look up something in
the docs"? (I assume "was exercising" didn't cause IDLE to crash)

--

___
Python tracker 

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



[issue6285] Silent abort on XP help document display

2009-06-14 Thread Scott David Daniels

Scott David Daniels  added the comment:

Help  /  Python31

Instead of docs showing up, all Idle windows closed.
To demonstrate for yourself, edit ~/.idlerc/config-main.cfg
add a line at the end (where additional docs show up), like:
4 = Python31c1;C:/Python31/Doc/python31c1.chm

(where the 4 is just over what you have already).  In my case, I
had a line much like the above left over from the previous candidate.

--Scott David Daniels
scott.dani...@acm.org

--

___
Python tracker 

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