[issue6377] distutils compiler switch ignored

2009-07-12 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

> I think a workable solution to the problem with the compiler
> option would be to remove the option from the build_ext,
> build_clib and config commands (plus any others, if there are
> more) and only allow it on the build command.

The problem I see is that sometimes, people are using the build_ext
command on its own:

  $ python setup.py build_ext -i --compiler mingw32

So that means build_ext is not a subcommand of build in this case.
While we can instanciate a build command on the fly to get our compiler
and work with it, using get_command_obj(). 

But the code will have to be careful and not use the cache with this
method e.g. to re-create a new build command to avoid using the same
command instance if another build_ is called.

What about making it all simpler, by creating a base command class that
manages a compiler through some methods (like get_compiler_obj), then
make all our build+build_* command inherit from it ?

That would resolve the code duplication and will make it simpler each
command to deal with a compiler.

This base command would have one single option. e.g. "compiler" 


> You'd still have the situation that .compiler is used as
> option string and then as compiler instance, but only for
> the short phase between .initialize_options() and
> .finalize_options() which is not all that much of a problem

I am not sure to understand how .compiler will become a string 
again after .finalize_options() has been called. Could you provide 
an example ?

--

___
Python tracker 

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



[issue6438] cygwinccompiler regular expressions broken

2009-07-12 Thread Tarek Ziadé

Changes by Tarek Ziadé :


--
resolution:  -> accepted
title: cygwincompiler regular expressions broken -> cygwinccompiler regular 
expressions broken

___
Python tracker 

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



[issue1616979] cp720 encoding map

2009-07-12 Thread Abdulmonem

Abdulmonem  added the comment:

As a user I experienced this bug. With  python 3.1, the interpreter 
terminate with fatal error:
"Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: cp720"

I think, this can be replicated by changing the active code page in the 
cmd session, before invoking the interpreter. The following command will 
do so:
> chcp 720

without the patch python would crash after this command.
I think testing the patch after this command is sufficient.

--
nosy: +abu_mohammed

___
Python tracker 

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



[issue6466] duplicate get_version() code between cygwinccompiler and emxccompiler

2009-07-12 Thread Tarek Ziadé

New submission from Tarek Ziadé :

Duplicate code, will create a single get_version() function in
distutils.util and make both commands use it + deprecate
cygwinccompiler.get_version and emxccompiler.get_version

--
assignee: tarek
components: Distutils
messages: 90441
nosy: tarek
priority: normal
severity: normal
status: open
title: duplicate get_version() code between cygwinccompiler and emxccompiler
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue6438] cygwinccompiler regular expressions broken

2009-07-12 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

done in r73975, r73976

--
status: open -> closed

___
Python tracker 

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



[issue6467] raw_input() doesn't work as expected when it gets multiple ^D

2009-07-12 Thread Lucas Prado Melo

New submission from Lucas Prado Melo :

--
$ cat raw_input_test.py
s = ''
try:
while True:
c = raw_input()
print c
s += c
except EOFError:
pass
$ python raw_input_test.py
test^D^Dtes
^D
$ python --version
Python 2.7a0
$ bash --version
GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
--

Surprisingly, though:

--
$ python raw_input_test.py > output
test^D^D^D
$ cat output
test
--
^D = Press Ctrl+D

I am using Ubuntu 9.04 (Jaunty Jackalope).

--
components: IO
messages: 90443
nosy: lucaspmelo
severity: normal
status: open
title: raw_input() doesn't work as expected when it gets multiple ^D
versions: Python 2.7

___
Python tracker 

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



[issue5870] subprocess.DEVNULL

2009-07-12 Thread Lucas Prado Melo

Lucas Prado Melo  added the comment:

-1 on this one.
It is not a portable decision (only *nix OSes do have /dev/null).
Also, why would we want it as a default constant? The subprocess module
would need to open /dev/null every time. Despite that, I can't see how
would someone use the redirection of errors to /dev/null through a
python script and, at the same time, make it seem not a bad practice at all.

--
nosy: +lucaspmelo

___
Python tracker 

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



[issue6393] OS X: python3 from python-3.1.dmg crashes at startup

2009-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Once this patch is checked in, should we do an emergency 3.1.1 release?

--
nosy: +benjamin.peterson, pitrou
priority:  -> critical
versions: +Python 3.2

___
Python tracker 

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



[issue5870] subprocess.DEVNULL

2009-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Lucas, Windows has a /dev/null-like device. I think Jean's suggestion is
reasonable, but it should be a special constant instead of creating a
file descriptor unconditionnally (that is, the file should only be open
if needed). Also, a patch should be provided (with tests :-)).

--
nosy: +pitrou

___
Python tracker 

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



[issue6393] OS X: python3 from python-3.1.dmg crashes at startup

2009-07-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'm don't know whether this is really worth a 3.1.1, all by itself.  
There's an easy workaround, which is for affected users to set their 
locale properly.

--

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2009-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Tomas, your patch is breaking an existing API, which may break existing
uses (I'm not sure which ones, but people are doing lots of things with
Python). That's why I proposed a separate API, which has the additional
benefit of making things clearer rather than muddier.

Besides, parsing of command line flags is already done in
Modules/main.c, we shouldn't repeat it in sysmodule.c.

--

___
Python tracker 

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



[issue6465] email.feedparser regular expression bug (NLCRE_crack)

2009-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can you include your unit test in your patch rather than as a separate
script? Existing unit tests are in Lib/test.

--
nosy: +pitrou

___
Python tracker 

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



[issue6468] __missing__ not completely implemented in dictobject.c

2009-07-12 Thread Bosko Vukov

New submission from Bosko Vukov :

For some reason functions PyDict_GetItem ( and PyDict_GetItemString )
don't try to check for '__missing__' on subclass, but
dict_subscript(dictobject *mp, register PyObject *key) does.
Only in this function a failure to get a value using
ma_lookup checks afterwards using !PyDict_CheckExact for subclass
definition of '__missing__', and then returns a value.
Is this intended or just a half implementation ?

--
components: None
messages: 90450
nosy: bvukov
severity: normal
status: open
title: __missing__ not completely implemented in dictobject.c
type: behavior
versions: Python 2.5

___
Python tracker 

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



[issue6468] __missing__ not completely implemented in dictobject.c

2009-07-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Yes, this is intended. PyDict_GetItem already bypasses user __getitem__
methods, so it's logical it would do the same for __missing__.

--
nosy: +benjamin.peterson
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



[issue6429] 2to3: fix_future conflicts with fix_print

2009-07-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r73981.

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



[issue2412] Check 2to3 for support of print function.

2009-07-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r73981.

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



[issue6465] email.feedparser regular expression bug (NLCRE_crack)

2009-07-12 Thread jkg

jkg  added the comment:

Combined patch as requested by pitrou.

(Sorry. This is my first submission.)

--
Added file: http://bugs.python.org/file14486/nlcre_full.patch

___
Python tracker 

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



[issue1772794] Telnetlib dosn't accept u'only ascii'

2009-07-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue6469] Function definition expressions feature

2009-07-12 Thread Chris Perkins

New submission from Chris Perkins :

Proposed feature - function definition expressions, superficially
similar to Ruby blocks.

To be proposed on Python-ideas list.

--
files: blocks.patch
keywords: patch
messages: 90455
nosy: grammati
severity: normal
status: open
title: Function definition expressions feature
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file14487/blocks.patch

___
Python tracker 

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



[issue6469] Function definition expressions feature

2009-07-12 Thread Chris Perkins

Chris Perkins  added the comment:

Forgot to mention - the patch is very much incomplete. It breaks tests,
contains none of the work that would need to be done in the ast package,
etc. This is just a proof-of-concept.

--

___
Python tracker 

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



[issue6470] Tkinter import fails when running Python.exe from a network share

2009-07-12 Thread Christoph Gohlke

New submission from Christoph Gohlke :

On Windows Vista 64-bit, when running Python 2.6.2 (32 or 64 bit) from a
network share, e.g. \\Server\Share\python26\python.exe,
importing Tkinter fails with "WindowsError: [Error 3] The system cannot
find the path specified". See session output below for traceback.

This is due to incomplete support for long UNC (UNCW) paths such as
\\?\UNC\Server\Share\File in FixTk.py. 

The attached patch solves this issue.

-Christoph


C:\>\\server\share\python26\python.exe
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from Tkinter import *
Traceback (most recent call last):
  File "", line 1, in 
  File "\\server\share\python26\lib\lib-tk\Tkinter.py", line 38, in 
import FixTk
  File "\\server\share\python26\lib\lib-tk\FixTk.py", line 59, in 
for name in os.listdir(prefix):
WindowsError: [Error 3] The system cannot find the path specified:
u'UNC\\server\\share\\Python26\\tcl\\*.*'

--
components: Tkinter, Windows
files: Tkinter-import-UNCW.patch
keywords: patch
messages: 90457
nosy: cgohlke
severity: normal
status: open
title: Tkinter import fails when running Python.exe from a network share
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file14488/Tkinter-import-UNCW.patch

___
Python tracker 

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



[issue6471] errno and strerror attributes incorrectly set on socket.error

2009-07-12 Thread Ezio Melotti

New submission from Ezio Melotti :

In Python 2.6, socket.error was changed to be a child class of IOError
[1]. IOError derives from EnvironmentError [2], and EnvironmentError
accepts a 2-tuple used to set the values of the errno and strerror
attributes respectively [3].
Apparently the IOError raised by the socket module are instantiated
passing (always?) 'socket error' as first arg and an instance of
socket.gaierror, socket.timeout or socket.herror (and maybe others) as
second arg.
The errno attributes ends up being a string (and not a number) and the
strerror another exception (and not a str):

>>> import socket
>>> from urllib import urlopen
>>> socket.setdefaulttimeout(0.01)
>>> try: urlopen('http://www.python.org')
... except Exception, e: err1 = e
...
>>> err1
IOError('socket error', timeout('timed out',))
>>> err1.errno
'socket error'
>>> err1.strerror
timeout('timed out',)
>>> err1.strerror.errno
>>> err1.strerror.strerror
>>>

>>> try: urlopen('http://www.pythonfoobarbaz.org')
... except Exception, e: err2 = e
...
>>> err2
IOError('socket error', gaierror(11001, 'getaddrinfo failed'))
>>> err1.errno
'socket error'
>>> err1.strerror
timeout('timed out',)
>>> err1.strerror.errno
>>> err2.errno
'socket error'
>>> err2.strerror
gaierror(11001, 'getaddrinfo failed')
>>> err2.strerror.errno
11001
>>> err2.strerror.strerror
'getaddrinfo failed'

The 'socket error' strings doesn't provide any useful information
(herror, gaierror and timeout are already subclasses of socket.error)
and it results in confusing messages like:
IOError: [Errno socket error] [Errno 11001] getaddrinfo failed

The relevant information is not accessible directly on the error but it
is in err.strerror/err.args[1].

IMHO the first arg should be the errno (if it's available) and the
second the message (e.g. 'getaddrinfo failed' or 'timed out').

The doc of socket.error [1] should be also changed because it says:
"The accompanying value is either a string telling what went wrong or a
pair (errno, string) representing an error returned by a system call,
similar to the value accompanying os.error." (and this is actually what
I'd like it to be, but right now it's something different.)

[1]: http://docs.python.org/library/socket.html#socket.error
[2]: http://docs.python.org/library/exceptions.html#exceptions.IOError
[3]:
http://docs.python.org/library/exceptions.html#exceptions.EnvironmentError

--
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 90458
nosy: ezio.melotti, georg.brandl
priority: normal
severity: normal
status: open
title: errno and strerror attributes incorrectly set on socket.error
type: behavior
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



[issue1616979] cp720 encoding map

2009-07-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Instead of using another source of third-party files, I suggest to use the 
Windows 
functions to generate the mapping.
The attached patch contains a script, genwincodec.py, which uses 
MultiByteToWideChar 
and generates a codec file.

I use it like this:
.\PCBuild\python Tools\unicode\genwincodec.py 720 > Lib\encodings\cp720.py

The generated file is also in the patch.

--
keywords: +needs review -patch
nosy: +amaury.forgeotdarc
stage: test needed -> patch review
Added file: http://bugs.python.org/file14489/genwincodec-trunk.patch

___
Python tracker 

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



[issue1616979] cp720 encoding map

2009-07-12 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
keywords: +patch
Added file: http://bugs.python.org/file14490/genwincodec-py3k.patch

___
Python tracker 

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



[issue6267] Cumulative patcc:h to http and xmlrpc

2009-07-12 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Added more regression tests in revision 73986 and revision 73987

--

___
Python tracker 

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



[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-07-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

In Py3.x, this fails:
"%s.%s.%s-%s-%s" % sys.version_info

The reason is that PyUnicode_Format() expects a real tuple, not a tuple
lookalike.  The fix is to either have structseq inherit from tuple or to
modify PyUnicode_Format() to handle structseq:

   if (PyCheck_StructSeq(args)) {
  newargs = PyTuple_FromSequence(args);
  if (newargs == NULL)
  return NULL;
  result = PyUncode_Format(format, newargs);
  Py_DECREF(newargs);
  return result;
   }

--
versions: +Python 3.2

___
Python tracker 

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



[issue6471] errno and strerror attributes incorrectly set on socket.error

2009-07-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

No, it seems that 2.5 has the same problem. The 'socket error' message is 
raised in urllib.py.  The socket module is innocent to me...
It appears that this file routinely raises IOErrors, passing various 
arguments, which are not stored properly in the IOError object. IMO it 
should raise subclasses of IOError.
In this particular case of "socket error", it should let the exception 
propagate. Other occurrences need more thinking.

--
assignee: georg.brandl -> 
components:  -Documentation
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6465] email.feedparser regular expression bug (NLCRE_crack)

2009-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Sorry for giving you a slightly wrong indication. The email tests are
called from Lib/test/test_email.py, but it redirects to
Lib/email/test/*. In any case, there's no point in creating a separate
test script for such a detail, you should add your test to one of the
existing test scripts instead.

--

___
Python tracker 

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



[issue6470] Tkinter import fails when running Python.exe from a network share

2009-07-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Confirmed here. Added a unit test.

--
assignee:  -> loewis
keywords: +needs review
nosy: +amaury.forgeotdarc, loewis
stage:  -> patch review
Added file: http://bugs.python.org/file14491/tk-unc.patch

___
Python tracker 

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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-07-12 Thread Mitchell Model

New submission from Mitchell Model :

I can't quite sort this out, because it's difficult to see what is
intended. The documentation of xml.etree.ElementTree (19.11 in the
Library doc) uses terms like "iterator", "tree iterator", "iterable",
"list" in vague and perhaps not quite accurate ways. I can't tell from
the documentation which functions/methods return lists, which return a
generator, which return an unspecified kind of iterable, and so on.
Moreover, the results are different using ElementTree than they are
using cElementTree. In particular, getiterator() returns a list in
ElementTree and a generator in cElementTree. This can make a substantial
difference in performance when iterating over a large number of nodes
(in addition to cElementTree's parsing being what appears to be about
10x faster).

I think someone should go over the page and sort this out and make it
clear what the user can expect. (I don't think it's fair to
overgeneralize to things like "iterables" if the module is really meant
to be making a commitment to a list or a generator.) I also think that
the differences in the results of methods returned in the Python and C
versions of the module should be highlighted.

I stumbled on this trying to parses and extract individual bits of
information out of large XML files. I full well realize there are better
ways to do this (SAX, e.g.) and better ways to search than just iterate
over all the tags of the type I'm interested in, but I should still know
what to expect from ElementTree, especially because it is so wonderful!

--
assignee: georg.brandl
components: Documentation
messages: 90465
nosy: MLModel, georg.brandl
severity: normal
status: open
title: Inconsistent use of "iterator" in ElementTree doc & diff between Py and 
C modules
versions: Python 3.0, 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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-07-12 Thread Jerry Chen

Changes by Jerry Chen :


--
nosy: +effbot

___
Python tracker 

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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-07-12 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee: georg.brandl -> effbot

___
Python tracker 

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



[issue6471] errno and strerror attributes incorrectly set on socket.error

2009-07-12 Thread R. David Murray

R. David Murray  added the comment:

Yes, it looks to me like urllib is intentionally putting the 'socket
error' or 'url error' into the errno position in the IOError arguments.
 Now that socket.error is an IOError, that at least seems wrong.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2009-07-12 Thread R. David Murray

Changes by R. David Murray :


--
title: errno and strerror attributes incorrectly set on socket.error -> errno 
and strerror attributes incorrectly set on socket errors wrapped by urllib

___
Python tracker 

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



[issue6473] hmac sha384/sha512 fails test vectors

2009-07-12 Thread Iain Wade

New submission from Iain Wade :

Test vectors are in the following draft rfc:
http://tools.ietf.org/html/draft-nystrom-smime-hmac-sha

The problem is that hmac.py has a hard-coded block size of 64, while 
SHA-384 and SHA-512 have a 128-byte block size.

Suggested fix is either:

a/ have the various hashlib libraries export block size (like they 
currently do for digest_size).

b/ parameterize blocksize to the constructor so that users can override.

c/ I have no third suggestion.

I have made available a codified version of the test vectors for your 
convenience.

--
components: Library (Lib)
files: test_vectors.py
messages: 90467
nosy: iwade
severity: normal
status: open
title: hmac sha384/sha512 fails test vectors
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file14492/test_vectors.py

___
Python tracker 

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



[issue1616979] cp720 encoding map

2009-07-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Amaury: your approach sounds fine to me, please apply.

--
resolution:  -> accepted

___
Python tracker 

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



[issue1616979] cp720 encoding map

2009-07-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Reconsidering, I'd like to ask for two changes:
- please record the command(s) used to generate tables on Windows
somewhere, in either Tools/unicode/Makefile, or a separate batch file.
- please arrange for the doc string of the generated file to identify
the source of the data base; in particular, make sure that the Windows
version on which this was run is identified. It might be that future
Windows versions change the mappings.

--

___
Python tracker 

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