[issue9951] introduce bytes.hex method

2010-10-01 Thread Nick Coghlan

Nick Coghlan  added the comment:

Patch generally looks good, but the type of retbuf is incorrect (should be 
Py_UNICODE* rather than wchar_t*).

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method

2010-10-01 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Yaroslav Halchenko

Yaroslav Halchenko  added the comment:

yikes... surprising resolution -- I expected that fix would either makes 
__abstractmethods__ accessible in derived "type"s or becomes absent from output 
of dir() -- but none of those has happened.  Now we ended up with a consistent 
non-Pythonic fate of __abstractmethods__ listed in output of dir() but not 
accessible.  is that a feature?

--

___
Python tracker 

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



[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

After working my way through the code I no longer think that parseaddr is 
working as designed.  I think that this is a bug, and that there is a missing 
call to quote in getaddrspec.  Attached is a revised set of unit tests and a 
fix.  The full python test suite passes with this fix in place, but note that 
initially I made a mistake in the patch and running test_email passed...that 
is, before the attached tests there were no tests of parseaddr in the email 
test suite.

I don't know if this patch is safe for backport, but I'm inclined that way.  It 
is hard to see how 3rd party code could be compensating for this bug, since it 
looses quoting information that doesn't appear to be algorithmically 
recoverable.

--
Added file: http://bugs.python.org/file19103/parseaddr_quote.diff

___
Python tracker 

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



[issue9974] tokenizer.untokenize not invariant with line continuations

2010-10-01 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Interesting, is that a separate defect of doctest?

--

___
Python tracker 

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



[issue10010] ".. index::" position

2010-10-01 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Fixed in py3k(r85156), release31-maint(r85157) and release27-maint(r85158).

--
nosy: +orsenthil
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue10012] httplib shadows builtin, assumes strings

2010-10-01 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-01 Thread Alex Quinn

Changes by Alex Quinn :


--
nosy:  -Alex Quinn

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

In case it isn't clear, the code patch is now complete, so anyone who wants to 
give it a review, please do.  I'll add the docs soon, but the basic idea is you 
can put bytes in by either using message_from_bytes or by using the 'ascii' 
codec and the 'surrogateescape' error handler on a file passed to 
msg_from_file, and you can get bytes out by using BytesGenerator and passing it 
a file-like object that accepts bytes.  As a side benefit, Generator will 
correctly render (as unicode) the content of a section with a 
ContentTransferEncoding of '8bit'.

--
stage: unit test needed -> patch review

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

New version of patch including a BytesGenerator.

--
Added file: http://bugs.python.org/file19102/email_parse_bytes3.diff

___
Python tracker 

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



[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-10-01 Thread Lenard Lindstrom

Lenard Lindstrom  added the comment:

Applied patch to:
Python 3.2a2+ (py3k:85150M, Oct  1 2010, 14:40:33) 
[GCC 4.4.5 20100728 (prerelease)] on linux2

Python unit test test_capi.py crashes:

internal test_broken_memoryview
* ob
object  : 
type: str
refcount: 0
address : 0xb7171178
* op->_ob_prev->_ob_next
object  : 
type: str
refcount: 0
address : 0xb7171178
* op->_ob_next->_ob_prev
object  : Segmentation fault

Pygame unit tests pass (segfaults without the patch).

bufrel.c test passes.

numpy 1.5.0 unit tests not run since they rely on a package that needs porting 
to Python 3.x. A memory view is used to manage an object whose buffer a numpy 
array exposes. This was where the Pygame unit test seqfault occurred.

The patch fixes the problem with Pygame.

Thanks.

--

___
Python tracker 

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



[issue9807] deriving configuration information for different builds with the same prefix

2010-10-01 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

bzr branch lp:~barry/python/issue9807

https://code.edge.launchpad.net/~barry/python/issue9807

--

___
Python tracker 

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



[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

As of r85154, type.__abstractmethods__ now raises an AttributeError, too.

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



[issue10012] httplib shadows builtin, assumes strings

2010-10-01 Thread Cliff Wells

New submission from Cliff Wells :

httplib.py ~Line 924

def putheader(self, header, *values):
str = '%s: %s' % (header, '\r\n\t'.join(values))
self._output(str)


should be changed to something like:


def putheader(self, header, *values):
...
s = '%s: %s' % (header, '\r\n\t'.join([str(v) for v in values]))
self._output(s)

The current version shadows str builtin with a local variable.  join method 
assumes strings so they should probably be explicitly cast (at least one 3rd 
party library appears to pass Content-length as an integer, causing this to 
fail.  Of course, this can't be done unless the str builtin is no longer 
shadowed.

--
components: Library (Lib)
messages: 117852
nosy: cwells
priority: normal
severity: normal
status: open
title: httplib shadows builtin, assumes strings
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



[issue9841] sysconfig and distutils.sysconfig differ in subtle ways

2010-10-01 Thread Éric Araujo

Éric Araujo  added the comment:

By “d2/sysconfig” I meant d2._backport.sysconfig.

--

___
Python tracker 

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



[issue9841] sysconfig and distutils.sysconfig differ in subtle ways

2010-10-01 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Not in distutils2 because we want to get rid of it, thats the whole point.
distutils2 will use the sysconfig module I've extracted from distutils.

--

___
Python tracker 

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



[issue10011] `except` doesn't use `isinstance`

2010-10-01 Thread Ram Rachum

Ram Rachum  added the comment:

I don't understand the infinite recursion argument. If there's such an infinite 
recursion, wouldn't it be due to a bug in the user's implementation of 
__instancecheck__?

--

___
Python tracker 

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



[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-01 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Allow bytes in some APIs that use string literals internally -> 
urllib.parse: Allow bytes in some APIs that use string literals internally

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread STINNER Victor

STINNER Victor  added the comment:

Ooops, I lost my patch to fix the initial (ctypes) issue. Here is an updated 
patch: ctypes_nonbmp.patch (which needs aswidechar_nonbmp-4.patch).

--
Added file: http://bugs.python.org/file19101/ctypes_nonbmp.patch

___
Python tracker 

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



[issue6691] Support for nested classes and function for pyclbr

2010-10-01 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Too late for version 2. I updated patch for 3.2, and tried to improve the 
documentation a little bit.

--
nosy: +amaury.forgeotdarc
versions:  -Python 2.7, Python 3.1
Added file: http://bugs.python.org/file19100/pyclbr_nested_objects-py3k.patch

___
Python tracker 

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



[issue10011] `except` doesn't use `isinstance`

2010-10-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Mainly to protect against potential infinite recursion with isinstance checks. 
Also, performance is probably better.

Here are the relevant code and comments in PyErr_GivenExceptionMatches() (in 
Python/errors.c):

/* PyObject_IsSubclass() can recurse and therefore is
   not safe (see test_bad_getattr in test.pickletester). */
res = PyType_IsSubtype((PyTypeObject *)err, (PyTypeObject *)exc);

--
nosy: +pitrou
versions:  -Python 2.5, Python 2.6, Python 2.7, Python 3.3

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file19083/aswidechar_nonbmp-3.patch

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file19082/aswidechar_nonbmp-2.patch

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread STINNER Victor

STINNER Victor  added the comment:

Patch version 4:
 - implement unicode_aswidechar() for 16 bits wchar_t and 32 bits Py_UNICODE
 - PyUnicode_AsWideWcharString() returns the number of wide characters 
excluding the nul character as does PyUnicode_AsWideChar()

For 16 bits wchar_t and 32 bits Py_UNICODE, I extracted the "as wide char" 
unicode functions into a small C file and compiled it with -fshort-wchar on 
Linux.

--
Added file: http://bugs.python.org/file19099/aswidechar_nonbmp-4.patch

___
Python tracker 

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



[issue10011] `except` doesn't use `isinstance`

2010-10-01 Thread Ram Rachum

New submission from Ram Rachum :

Is there a reason why `execpt` compares base classes instead of using 
`isinstance`? This prevents using `__instancecheck__` to override the instance 
check.

--
components: Interpreter Core
messages: 117844
nosy: cool-RR
priority: normal
severity: normal
status: open
title: `except` doesn't use `isinstance`
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue9807] deriving configuration information for different builds with the same prefix

2010-10-01 Thread Éric Araujo

Éric Araujo  added the comment:

Sorry, I was replying to this:
“I'm still investigating that, but in the meantime, please go to codereview and 
let me know what you think so far.”

I meant that for the distutils part, I’ve seen nothing bad.  I have no idea 
about the import bug.

--

___
Python tracker 

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



[issue9807] deriving configuration information for different builds with the same prefix

2010-10-01 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Éric: which patch: file18807, or http://codereview.appspot.com/2340041/?

--

___
Python tracker 

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



[issue9807] deriving configuration information for different builds with the same prefix

2010-10-01 Thread Éric Araujo

Éric Araujo  added the comment:

I see nothing obviously wrong in the patch.

--

___
Python tracker 

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



[issue1195571] simple callback system for Py_FatalError

2010-10-01 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


Added file: http://bugs.python.org/file19098/fatalhook-2.patch

___
Python tracker 

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



[issue1195571] simple callback system for Py_FatalError

2010-10-01 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


Removed file: http://bugs.python.org/file19096/fatalhook-2.patch

___
Python tracker 

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



[issue2771] test issue

2010-10-01 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Attach some file

--
keywords: +patch
Added file: http://bugs.python.org/file19097/README.diff

___
Python tracker 

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



[issue1195571] simple callback system for Py_FatalError

2010-10-01 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


Added file: http://bugs.python.org/file19096/fatalhook-2.patch

___
Python tracker 

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



[issue1195571] simple callback system for Py_FatalError

2010-10-01 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Here is a new patch; I lifted the pre-Py_Initialize() restriction, because it 
seems to me that a wxPython application, for example, could use it.
A wxPython application is not embedded, but it already often redirects stdout 
and even installs a segfault handler.

I also made Py_SetFatalHook() return the previous hook; it could be useful to 
set a function temporarily, even if this is not thread safe.

--
stage: unit test needed -> patch review

___
Python tracker 

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



[issue8190] Add a PyPI XML-RPC client module

2010-10-01 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution: accepted -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue8190] Add a PyPI XML-RPC client module

2010-10-01 Thread Alexis Metaireau

Alexis Metaireau  added the comment:

Yes, all the functions are covered. By the way, I've covered all the functions 
based on the pypi source code, not on the wiki.

I'll update the wiki page with some examples soon :)

--

___
Python tracker 

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



[issue9841] sysconfig and distutils.sysconfig differ in subtle ways

2010-10-01 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue5501] Update multiprocessing docs re: freeze_support

2010-10-01 Thread Éric Araujo

Éric Araujo  added the comment:

I’m assuming this is a feature new in 2.7 and 3.2, please add 3.1 if this is 
wrong.

--
nosy: +d...@python, eric.araujo

___
Python tracker 

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



[issue5088] optparse: inconsistent default value for append actions

2010-10-01 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the patch.  Some remarks:

>  :attr:`~Option.dest` variable, that already contains the default value
I would have used “which” here, but I’m not a native speaker.

> not replaced (contrary to what one can think)
I’d have used a comma, not parens.

> This behaviour is clear
“makes sense” sounds better to me.

> think that with a default value :attr:`~Option.dest` is a list
I suggest a comma after “value”.

> any additional option is appended to that list
s/option/value/

Let me use this reply to welcome you in the bug tracker.  I hope you get warn 
fuzzy feelings when your patches are accepted or your comments acted upon.  I’m 
also looking forward for a better Python-Debian relationship.  (Cultural note: 
It’s not usual to say hello and regards in messages on this tracker.  I did it 
too at first but was told it was unnecessary.)  :)

--
assignee: georg.brandl -> d...@python
nosy: +d...@python, eric.araujo
stage:  -> patch review
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



[issue10010] ".. index::" position

2010-10-01 Thread Éric Araujo

Éric Araujo  added the comment:

+1 on the patch.  I suspect there is the same problem for other links.

--
nosy: +eric.araujo
versions: +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



[issue8879] Implement os.link on Windows

2010-10-01 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I think this is because os.stat and os.lstat doesn't set st_nlink.
It is only set via os.fstat. I'll attach quick hack patch. (Again,
this is just quick hack patch)

I confirmed this passes test_os and test_tarfile.

--
Added file: http://bugs.python.org/file19091/py3k_quick_hack_for_issue8879.patch

___
Python tracker 

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



[issue10010] ".. index::" position

2010-10-01 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

Hello. While I was reading HTML help, I felt some links
were not pointing to *before* what I wanted to read. When
I selected "sort (list method)" in keyword pane, it jumped
to *Note* section, but I was not sure where I was. Table
above was actually what I wanted to read.

With attached patch, I am happy.

--
assignee: d...@python
components: Documentation
files: py27_doc_index.patch
keywords: patch
messages: 117833
nosy: d...@python, ocean-city
priority: normal
severity: normal
status: open
title: ".. index::" position
versions: Python 2.7
Added file: http://bugs.python.org/file19090/py27_doc_index.patch

___
Python tracker 

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



[issue8190] Add a PyPI XML-RPC client module

2010-10-01 Thread Éric Araujo

Éric Araujo  added the comment:

My bad, I took Tarek’s line about “implementing all functions” literally.  Your 
client classes don’t have methods with the same exact names and signatures, but 
what matters is that they provide the functionality.  If you can review the 
functions listed on the XML-RPC wiki page and confirm they have an equivalent 
in d2.index, this bug will be closed :)  Bonus points if you create a wiki page 
explaining how to do operations listed on the XML-RPC page in distutils2.

--

___
Python tracker 

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



[issue9974] tokenizer.untokenize not invariant with line continuations

2010-10-01 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue10009] Automated MSI installation does not work

2010-10-01 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc :

>From an old post on python-dev:
2010/08/04 Paul Kippes:
> For the most part, the information at
> http://www.python.org/download/releases/2.4/msi/ assisted me with
> automating a 2.7 installation on Windows XP.  The following initial
> attempt, however, failed to provide a working python installation.
> (Messages are either "The system cannot execute the specified
> program." or "This application has failed to start because the
> application configuration is incorrect.  Reinstalling the application
> may fix this problem.")
>
> msiexec /qb /i python-2.7.msi ALLUSERS=1 ADDLOCAL=Extensions
>
> After looking through Tools/msi/msi.py, I was able to automate a
> minimal and working Python installation with this adjustment:
>
> ADDLOCAL=Extensions,SharedCRT
>
> Since the only reference I could find to the above web page was when
> the MSI installer was first announced
> (http://www.python.org/download/releases/2.4.2), the installer options
> may have changed since then.
>
> Would you check if my change is what you intended and perhaps migrate
> the web page of the 2.4 release note to 2.7?
>
> Thanks!

--
components: Installation
messages: 117831
nosy: amaury.forgeotdarc, loewis
priority: normal
severity: normal
status: open
title: Automated MSI installation does not work

___
Python tracker 

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



[issue9985] difflib.SequenceMatcher has slightly buggy and undocumented caching behavior

2010-10-01 Thread Ned Deily

Ned Deily  added the comment:

(+nosy Raymond as committer of r59907 and removing python2.6 since this is not 
a security issue)

--
nosy: +ned.deily, rhettinger
stage:  -> needs patch
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



[issue9996] binascii should convert unicode strings

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

Since the issue/patch is about binascii, and I agree with Martin that binascii 
should continue to do bytes-to-bytes transforms (especially since that is its 
most common use case, IMO), I'm going to close this issue.  Please open the 
discussion on python-dev or python-ideas if you wish to proceed with some sort 
of feature request.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue8879] Implement os.link on Windows

2010-10-01 Thread Brian Curtin

Brian Curtin  added the comment:

test_tarfile fails with this patch.

--

___
Python tracker 

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



[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-10-01 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file19088/memview.patch

___
Python tracker 

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



[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-10-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Of course, a patch is always better without the debugging prints :)

--
Added file: http://bugs.python.org/file19089/memview.patch

___
Python tracker 

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



[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-10-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch that fixes the issue. Can you try it?

Unfortunately, more advanced uses such a slicing the memoryview are still 
crashing. That's because the new buffer protocol doesn't define ownership of 
Py_buffer structs. As a result, nothing can be assumed at to which piece of 
code is responsible for allocation and deallocation of related memory areas 
(such as shapes and strides arrays).

--
keywords: +patch
nosy: +ncoghlan, teoliphant
stage: needs patch -> patch review
Added file: http://bugs.python.org/file19088/memview.patch

___
Python tracker 

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



[issue9977] TestCase.assertItemsEqual's description of differences

2010-10-01 Thread Matthew Woodcraft

Matthew Woodcraft  added the comment:

Terry J. Reedy wrote:
> If I understand correctly, you are requesting that .assertItemsEqual
> only use the 2nd (multiset comparison) method, so that if one want the
> first method, one should directly call .assertSequenceEqual(sorted(a),
> sorted(b)).

Yes, that would make me happy. So would a new assertXXXEqual method that
always did the multiset comparison.

--

___
Python tracker 

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



[issue10008] Two links point to same place

2010-10-01 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

Please see http://docs.python.org/genindex-T.html

  Thread (class in threading), [1]

This two links point to same place. I think latter should point
http://docs.python.org/library/threading.html#thread-objects
or
class threading.Thread(group=None, target=None, name=None, args=(), kwargs={})
bellow.

# Latter doesn't have perma link.

--
assignee: d...@python
components: Documentation
messages: 117824
nosy: d...@python, ocean-city
priority: normal
severity: normal
status: open
title: Two links point to same place
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



[issue5501] Update multiprocessing docs re: freeze_support

2010-10-01 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hello,
well it's just 3 words that can clarify the situation, so maybe just add them 
would be nice

Regards,
Sandro

--
nosy: +sandro.tosi

___
Python tracker 

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



[issue9977] TestCase.assertItemsEqual's description of differences

2010-10-01 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If I understand correctly, you are requesting that .assertItemsEqual only use 
the 2nd (multiset comparison) method, so that if one want the first method, one 
should directly call .assertSequenceEqual(sorted(a), sorted(b)).

This seems reasonable to me, but I do not use the unittest module, and I 
suspect others want the implicit call.

--
nosy: +terry.reedy
stage:  -> unit test needed

___
Python tracker 

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



[issue9997] function named 'top' gets unexpected namespace/scope behaviour

2010-10-01 Thread Jeremy Thurgood

Changes by Jeremy Thurgood :


--
nosy: +jerith

___
Python tracker 

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



[issue5088] optparse: inconsistent default value for append actions

2010-10-01 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hello,
attached a patch to add documentation about action=append and a default value.

Regards,
Sandro

--
keywords: +patch
nosy: +sandro.tosi
Added file: http://bugs.python.org/file19087/issue5088-py3k.patch

___
Python tracker 

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



[issue9943] TypeError message became less helpful in Python 2.7

2010-10-01 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

FWIW 3.1 gives same message as 2.6. I have not installed 3.2a yet to check that.

Reporting of argument count mismatch has always been problematical, especially 
for methods. I almost think the message should be simplified to "Arguments 
passed do not match function signature." Programmers who do not immediately 
immediately see the problem (because they know the signature but made an 
inadvertent mistake) will have to check the signature anyway.

The alternative should be a clearer and more complete report than currently, 
which will take more than one line.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue9985] difflib.SequenceMatcher has slightly buggy and undocumented caching behavior

2010-10-01 Thread Marien Zwart

Marien Zwart  added the comment:

That fixes the first problem in python 2. It should do:

self.matching_blocks = [Match._make(t) for t in non_adjacent]

in python 3 though, or it will return an already-exhausted map object if it is 
called again.

This leaves the problem of other code mutating the cached list (not realizing 
it is cached). I think it would make sense for these functions to just return a 
shallow copy of their cached list, but I have not thought that through much.

--

___
Python tracker 

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



[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

It does appear as though parseaddr is dropping quoting information from the 
returned parsed address.  Fixing this is likely to create backward 
compatibility issues, and I'm very curious to know why parseaddr drops the 
quoting info.

Note that I do not observe the change from test\com to test.com, so I'm 
assuming that was a typo and ignoring that part (or it represents a bug that is 
already fixed).

The "weird" example is actually consistent with the rest of parseaddr's 
behavior, if you understand that behavior as turning quoted pairs inside quoted 
strings into their literal value, but leaving the quotes around the quoted 
string(s) in place.

Consider the example:

  parseaddr('""test" test"@test.com')

If we remove the Python quoting from this input string we have:

  "\\"test\\" test"@test.com

Interpreting this according to RFC rules we have a quoted string "\\" 
containing a quoted pair (\\).  The quoted pair resolves to a single \.  Then 
we have the unquoted text
 
   test\\

This parseaddr copies literally (I'm not sure if that is strictly RFC 
compliant, but given that we are supposed to be liberal in what we except it is 
as reasonable a thing to do as any.)  Finally we have another quoted string

   " test"

So putting those pieces together according to the rules above, we end up with:

   "\"test\\" test"@test.com

which is the observed output once you remove the Python quoting.  So, parseaddr 
is working as designed.  The question is, what is the design decision behind 
resolving the quoted pairs but leaving the quotes?

--

___
Python tracker 

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



[issue10003] signal.SIGBREAK regression on windows

2010-10-01 Thread Martin

Martin  added the comment:

Thanks for the quick resolution Brian, head now works as expected.

--

___
Python tracker 

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



[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue10003] signal.SIGBREAK regression on windows

2010-10-01 Thread Brian Curtin

Brian Curtin  added the comment:

Fixed in r85140 (py3k), r85141 (release31-maint), and r85145 (release27-maint).

Thanks for the report!

--
resolution: accepted -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue9986] PDF files of python docs have text missing

2010-10-01 Thread Amber Jain

Amber Jain  added the comment:

Reported to sphinx tracker at bitbucket:
http://bitbucket.org/birkenfeld/sphinx/issue/531/pdf-files-of-python-docs-have-text-missing

--

___
Python tracker 

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



[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I see the problem; will consider/fix later today hopefully.

--
assignee:  -> benjamin.peterson

___
Python tracker 

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



[issue9286] email.utils.parseaddr returns garbage for invalid input

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

In the first of your examples, parseaddr is correct (a lone token is considered 
a 'local' address per RFC).

The second one is prossibly wrong, but if so the correct way to interpret it is 
not clear.  If you read the RFC carefully 
(http://tools.ietf.org/html/rfc5322#section-4.4), spaces are allowed between 
the 'local part' and the domain in obsolete syntax (which must be accepted).  
However, the space being elided here is between pieces of the local part.  Note 
that because the address is not in '<>', the whole string is the address, 
there's no name field.  The "correct" parse could be:

('', '"merwok wok"@rusty')

That is, we apply a 'be generous in what you accept' rule and assume the "s 
were forgotten.  However, perhaps a more sensible 'generous' rule would be to 
assume the '<>' were forgotten and return

('merwok', 'w...@rusty')

However, it is quite possible that the reason the space is being elided here 
has to do with handling the obsolete 'route' syntax.  If that is the case then 
parseaddr is probably correct.  It may be a while before I get around to 
understanding that part of the spec well enough to render a judgement, so in 
the meantime I'll assume parseaddr is correct.  Feel free to read the spec and 
render your own opinion :)

--

___
Python tracker 

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



[issue6664] readlines should understand Line Separator and Paragraph Separator characters

2010-10-01 Thread Jeffrey Finkelstein

Jeffrey Finkelstein  added the comment:

This seems to be because codecs.StreamReader.readlines() function does this:

def readlines(self, sizehint=None, keepends=True):
data = self.read()
return data.splitlines(keepends)

But the io readlines() functions make multiple calls to readline() instead.

Here is the test case which passes on the codecs readlines() but fails on the 
io readlines().

--
keywords: +patch
nosy: +jfinkels
Added file: http://bugs.python.org/file19086/issue6664.testcase.patch

___
Python tracker 

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



[issue9974] tokenizer.untokenize not invariant with line continuations

2010-10-01 Thread Brian Bossé

Brian Bossé  added the comment:

No idea if I'm getting the patch format right here, but tally ho!

This is keyed from release27-maint

Index: Lib/tokenize.py
===
--- Lib/tokenize.py (revision 85136)
+++ Lib/tokenize.py (working copy)
@@ -184,8 +184,13 @@
 
 def add_whitespace(self, start):
 row, col = start
-assert row <= self.prev_row
 col_offset = col - self.prev_col
+# Nearly all newlines are handled by the NL and NEWLINE tokens,
+# but explicit line continuations are not, so they're handled here.
+if row > self.prev_row:  
+row_offset = row - self.prev_row
+self.tokens.append("\\\n" * row_offset)
+col_offset = col  # Recalculate the column offset from the start 
of our new line
 if col_offset:
 self.tokens.append(" " * col_offset)

Two issues remain with this fix, both of which replace the assert with 
something functional but not exactly what the original text is:
1)  Whitespace leading up to a line continuation is not recreated.  The 
information required to do this is not present in the tokenized data.
2)  If EOF happens at the end of a line, the untokenized version will have a 
line continuation on the end, as the ENDMARKER token is represented on a line 
which does not exist in the original.

I spent some time trying to get a unit test written that demonstrates the 
original bug, but it would seem that doctest (which test_tokenize uses) cannot 
represent a '\' character properly.  The existing unit tests involving line 
continuations pass due to the '\' characters being interpreted as ERRORTOKEN, 
which is not as they're done when read from file or interactive prompt.

--

___
Python tracker 

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



[issue9921] os.path.join('x','') behavior

2010-10-01 Thread Radu Grigore

Radu Grigore  added the comment:

I would say something like the following.

The function join(path1, path2) is almost like os.sep.join(path1, path2), but 
(1) trailing path separators in path1 are ignored and (2) the result is simply 
path2 when path2 is an absolute path. The call join(path1, path2, path3) is 
equivalent to join(join(path1, path2), path3), and similarly for more than 
three paths.

--

___
Python tracker 

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



[issue10004] email/quoprimime.py Exception (with patch)

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

Committed in r85142 for 3.2, r85143 for 3.1, and r85144 for 2.7.

Thanks, Thomas.

--
resolution:  -> fixed
stage: unit test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10004] email/quoprimime.py Exception (with patch)

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

Here is Thomas's patch with a (simpler) unit test included.

--
Added file: http://bugs.python.org/file19085/quoprime_chars.patch

___
Python tracker 

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



[issue10004] email/quoprimime.py Exception (with patch)

2010-10-01 Thread R. David Murray

Changes by R. David Murray :


--
assignee:  -> r.david.murray

___
Python tracker 

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



[issue10004] email/quoprimime.py Exception (with patch)

2010-10-01 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> unit test needed
type:  -> behavior

___
Python tracker 

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



[issue10004] email/quoprimime.py Exception (with patch)

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

Heh, cut and paste gone mad, sorry about that title change/change back.

I can reproduce this in 3.2, so adding 3.1 and 3.2 to versions.

--
nosy: +r.david.murray
versions: +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



[issue10004] email/quoprimime.py Exception (with patch)

2010-10-01 Thread R. David Murray

Changes by R. David Murray :


--
title: irhe -> email/quoprimime.py Exception (with patch)

___
Python tracker 

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



[issue10004] irhe

2010-10-01 Thread R. David Murray

Changes by R. David Murray :


--
title: email/quoprimime.py Exception (with patch) -> irhe

___
Python tracker 

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



[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue10007] Visual C++ cannot build _ssl and _hashlib if newer OpenSSL is placed in $(dist) directory (PCBuild)

2010-10-01 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

> Python3.1 cannot build _ssl and _hashlib.

And Python2.7 cannot.

--

___
Python tracker 

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



[issue10007] Visual C++ cannot build _ssl and _hashlib if newer OpenSSL is placed in $(dist) directory (PCBuild)

2010-10-01 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

Visual C++ cannot build _ssl and _hashlib if newer OpenSSL
is placed in $(dist) directory. This happens on PCbuild.

Python3.2 uses openssl-1.0.0a
Python3.1 and 2.7 uses openssl-0.9.8l

If the directory layout is like this, Python3.1
cannot build _ssl and _hashlib.

python-dev
   +- openssl-0.9.8l
   +- openssl-1.0.0a
   +- py3k
   +- release31-maint
   +- release27-maint

Because build_ssl.py in release31-maint thinks newer
is better, and select openssl-1.0.0a, but pyproject.vsprops
hard-corded $(openssldir) as openssl-0.9.8l. So Modules/ssl.c
cannot import ssl.h and so on.

--
components: Build
messages: 117805
nosy: ocean-city
priority: normal
severity: normal
status: open
title: Visual C++ cannot build _ssl and _hashlib if newer OpenSSL is placed in 
$(dist) directory (PCBuild)
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



[issue6608] asctime does not check its input

2010-10-01 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Committed with minor changes in r85137.   Thanks for the patch!

--
resolution:  -> accepted
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10002] Installer doesn't install on Windows Server 2008 DataCenter R2

2010-10-01 Thread Brian Curtin

Brian Curtin  added the comment:

> Have you tried your Python 2.7 on a Windows Server 2008 R2?

It works on my 2008 R2 Enterprise Edition.

--
components: +Windows
nosy: +brian.curtin

___
Python tracker 

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



[issue9533] metaclass can't derive from ABC

2010-10-01 Thread Daniel Urban

Daniel Urban  added the comment:

If we create a new class, which is a metaclass, and also inherits an ABC, we 
create a new instance of ABCMeta.

When ABCMeta.__new__ creates the __abstractmethods__ attribute of the new 
class, it iterates over the __abstractmethods__ attribute of every base class 
(and checks every name in it, if it's abstract in the new class). One of the 
base classes of a metaclass is of course type. The type.__abstractmethods__ 
object is a getset descriptor (its __set__ switches some flags in tp_flags), 
which isn't iterable, so it raises the exception. 

Ideas for possible solutions:
1. In ABCMeta.__new__ special case type (do not check its 
__abstractmethods__attribute). 
2. In ABCMeta.__new__ check if the __abstractmethods__ attribute is in fact an 
iterable, before we try to iterate over it. (I don't think this would be a very 
good solution, because if a base class' __abstractmethods__ isn't iterable, it 
should be an error, except if the base class is type itself. So we should 
special case type anyway.)

I can't come up with a use case for this right now, but I don't see why it 
shouldn't work.

--
components: +Library (Lib)

___
Python tracker 

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



[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Andreas Stührk

Changes by Andreas Stührk :


--
nosy: +Trundle

___
Python tracker 

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



[issue9985] difflib.SequenceMatcher has slightly buggy and undocumented caching behavior

2010-10-01 Thread Christoph Burgmer

Christoph Burgmer  added the comment:

BTW, here's the commit that broke the behavior in the first place: 
http://svn.python.org/view/python/trunk/Lib/difflib.py?r1=54230&r2=59907

--

___
Python tracker 

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



[issue9985] difflib.SequenceMatcher has slightly buggy and undocumented caching behavior

2010-10-01 Thread Christoph Burgmer

Christoph Burgmer  added the comment:

Here's a test case and a fix for get_matching_blocks() to return the same 
content on subsequent calls.

--
keywords: +patch
nosy: +christoph
Added file: http://bugs.python.org/file19084/get_matching_blocks.diff

___
Python tracker 

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



[issue10005] Postgresql calls undefined method in __str__

2010-10-01 Thread R. David Murray

R. David Murray  added the comment:

There is no postgresql client in the Python standard library, you'll need to 
report this bug on the appropriate project's tracker.

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Yaroslav Halchenko

New submission from Yaroslav Halchenko :

We ran into this while generating documentation for our project (PyMVPA) with 
recent sphinx and python2.6 (fine with 2.5, failed for 2.6, 2.7, 3.1), which 
relies on traversing all attributes given by "dir(obj)", BUT apparently 
__abstractmethods__ becomes very special -- it is given by "dir(obj)" since it 
is present in obj.__class__, but getattr(obj, "__abstractmethods__") fails for 
classes derived from type.  E.g. following sample demonstrates it:

print("in type's dir" , '__abstractmethods__' in dir(type))
print(type.__abstractmethods__)

class type3(type):
pass

print("in type3's dir" , '__abstractmethods__' in dir(type3))
print(type3.__abstractmethods__)


results in output:

$> python2.6 trash/type_subclass.py
("in type's dir", True)

("in type3's dir", True)
Traceback (most recent call last):
  File "trash/type_subclass.py", line 9, in 
print(type3.__abstractmethods__)
AttributeError: __abstractmethods__


$> python3.1 trash/type_subclass.py 
in type's dir True

in type3's dir True
Traceback (most recent call last):
  File "trash/type_subclass.py", line 9, in 
print(type3.__abstractmethods__)
AttributeError: __abstractmethods__


And that seems to be the only attribute behaving like that (others are fine and 
accessible).  Some people even seems to provide workarounds already, e.g.:
http://bitbucket.org/DasIch/bpython-colorful/src/19bb4cb0a65d/bpython/repl.py
when __abstractmethods__ is accessed only for the subclasses of ABCmeta ...

so, is it a bug or a feature (so we have to take care about it in all 
traversals of attributes given by dir())? ;)

--
messages: 117798
nosy: Yaroslav.Halchenko
priority: normal
severity: normal
status: open
title: non-Pythonic fate of __abstractmethods__
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



[issue3488] Provide compress/uncompress functions on the gzip module

2010-10-01 Thread Anand B Pillai

Anand B Pillai  added the comment:

Okay. Verified as working. Thank you!

--

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Daniel Stutzbach wrote:
> 
> Daniel Stutzbach  added the comment:
> 
>> You can tweak the Windows pyconfig.h to use UCS4, AFAIK, if you want to
>> test drive this case.
> 
> I seem to recall seeing some other code that assumed Windows implied UCS2.  
> Proceed with caution. ;-)

Probably, yes. I've never tried it myself.

>> But it's probably easier to configure with "gcc -fshort-wchar" on
>> Linux :-)
> 
> libc will still be using sizeof(wchar_t) == 4, though.  Won't that cause Bad 
> Things to happen when calling libc wide-character functions?

Sure, but this is just about testing an interface, not running
applications :-)

Here's what the GCC man-page has to say:

   -fshort-wchar
   Override the underlying type for wchar_t to be short unsigned int 
instead
   of the default for the target.  This option is useful for building
   programs to run under WINE.

   Warning: the -fshort-wchar switch causes GCC to generate code that 
is not
   binary compatible with code generated without that switch.  Use it to
   conform to a non-default application binary interface.

--

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

> You can tweak the Windows pyconfig.h to use UCS4, AFAIK, if you want to
> test drive this case.

I seem to recall seeing some other code that assumed Windows implied UCS2.  
Proceed with caution. ;-)

> But it's probably easier to configure with "gcc -fshort-wchar" on
> Linux :-)

libc will still be using sizeof(wchar_t) == 4, though.  Won't that cause Bad 
Things to happen when calling libc wide-character functions?

--

___
Python tracker 

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



[issue10005] Postgresql calls undefined method in __str__

2010-10-01 Thread Popa Claudiu

Popa Claudiu  added the comment:

I meant "Connection class calls the.."

--

___
Python tracker 

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



[issue10005] Postgresql calls undefined method in __str__

2010-10-01 Thread Popa Claudiu

New submission from Popa Claudiu :

In postgresql library, client3.py, the "__str__" method defined in Connection 
close calls the undefined method self.exception_string as in the following line 
of code:

excstr = ''.join(self.exception_string(type(self.exception), self.exception))

--
components: Library (Lib)
messages: 117793
nosy: Popa.Claudiu
priority: normal
severity: normal
status: open
title: Postgresql calls undefined method in __str__
type: behavior
versions: 3rd party

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> STINNER Victor  added the comment:
> 
> I don't know how to test "if Py_UNICODE_SIZE == 4 && SIZEOF_WCHAR_T == 2". On 
> Windows, sizeof(wchar_t) is 2, but it looks like Python is not prepared to 
> have Py_UNICODE != wchar_t for is Windows implementation.
>
> wchar_t is 32 bits long on Linux and Mac OS X. So how can I test it? Or 
> should we just drop support of "Py_UNICODE_SIZE == 4 && SIZEOF_WCHAR_T == 2"?

You can tweak the Windows pyconfig.h to use UCS4, AFAIK, if you want to
test drive this case.

But it's probably easier to configure with "gcc -fshort-wchar" on
Linux :-)

Dropping support for this is not a good idea.

--
title: c_types.c_wchar should not assume that sizeof(wchar_t) == 
sizeof(Py_UNICODE) -> c_types.c_wchar should not assume that sizeof(wchar_t) == 
   sizeof(Py_UNICODE)

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

I, too, can't think of any platforms where Py_UNICODE_SIZE == 4 && 
SIZEOF_WCHAR_T == 2 and I'm not sure what the previous policy has been.  Have 
you noticed any other code that would set a precedent?

If no one else chimes in, perhaps ask on IRC or python-dev?

--

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread STINNER Victor

STINNER Victor  added the comment:

I don't know how to test "if Py_UNICODE_SIZE == 4 && SIZEOF_WCHAR_T == 2". On 
Windows, sizeof(wchar_t) is 2, but it looks like Python is not prepared to have 
Py_UNICODE != wchar_t for is Windows implementation.

wchar_t is 32 bits long on Linux and Mac OS X. So how can I test it? Or should 
we just drop support of "Py_UNICODE_SIZE == 4 && SIZEOF_WCHAR_T == 2"?

--

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread STINNER Victor

STINNER Victor  added the comment:

Patch version 3:
 - fix unicode_aswidechar if Py_UNICODE_SIZE == SIZEOF_WCHAR_T and w == NULL 
(return the number of characters, don't write into w!)
 - improve unicode_aswidechar() comment

--
Added file: http://bugs.python.org/file19083/aswidechar_nonbmp-3.patch

___
Python tracker 

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



[issue9962] GzipFile doesn't have peek()

2010-10-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Right, I missed the change from self.max_read_chunk to 1024
> (read_size). Should not peek() limit to self.max_read_chunk as read()
> does?

This is used for the chunking of huge reads, but for peek():
1) there is no chunking (peek() should do at most one raw read)
2) huge reads are not really the use case peek() is intended for

--

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: 
http://bugs.python.org/file17322/pyunicode_aswidechar_surrogates-py3k.patch

___
Python tracker 

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



[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread STINNER Victor

STINNER Victor  added the comment:

Update the patch for the new PyUnicode_AsWideCharString() function:
 - use Py_UNICODE_SIZE and SIZEOF_WCHAR_T in the preprocessor tests
 - faster loop: don't use a counter + pointer, but only use pointers (for the 
stop condition)

The patch is not finished: I have to implement "#elif Py_UNICODE_SIZE == 4 && 
SIZEOF_WCHAR_T == 2" case.

--
Added file: http://bugs.python.org/file19082/aswidechar_nonbmp-2.patch

___
Python tracker 

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



[issue9962] GzipFile doesn't have peek()

2010-10-01 Thread Nir Aides

Nir Aides  added the comment:

Right, I missed the change from self.max_read_chunk to 1024 (read_size). Should 
not peek() limit to self.max_read_chunk as read() does?

--

___
Python tracker 

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



[issue9962] GzipFile doesn't have peek()

2010-10-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Should be min(n, 1024) instead of max(...)

Well, no, because we want to buffer a non-trivial amount of bytes for
the next accesses. So, if n < 1024, buffer at least 1024 bytes.

--

___
Python tracker 

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



  1   2   >