[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

An option of `configure` could be added, whose enabling would change
this behavior.

--
title: Non-zero exit status of setup.py when building of extensions has failed 
-> Add option of non-zero exit status of setup.py when building of extensions 
has failed

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The problem is actually wider::
>>> getattr(None, "\udc80")
Segmentation fault
An idea would be to change _PyUnicode_AsDefaultEncodedString and allow
unpaired surrogates (utf8+surrogateescape, as explained in PEP383), but
I fear the consequences...

The code that fails seems pretty common:
PyErr_Format(PyExc_AttributeError,
 "'%.50s' object has no attribute '%.400s'",
 tp->tp_name, _PyUnicode_AsString(name));
It would be unfortunate to replace all usages of _PyUnicode_AsString to
check the return value.

Martin, what do you think?

--
nosy: +amaury.forgeotdarc, loewis

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Amaury Forgeot d'Arc wrote:
> 
> Amaury Forgeot d'Arc  added the comment:
> 
> The problem is actually wider::
> >>> getattr(None, "\udc80")
> Segmentation fault
> An idea would be to change _PyUnicode_AsDefaultEncodedString and allow
> unpaired surrogates (utf8+surrogateescape, as explained in PEP383), but
> I fear the consequences...
>
> The code that fails seems pretty common:
>   PyErr_Format(PyExc_AttributeError,
>"'%.50s' object has no attribute '%.400s'",
>tp->tp_name, _PyUnicode_AsString(name));
> It would be unfortunate to replace all usages of _PyUnicode_AsString to
> check the return value.

The use of _PyUnicode_AsString() is wrong here. There are several
cases where it can fail, e.g. MemoryErrors, embedded NULs, encoding
errors.

The same is true for _PyUnicode_AsStringAndSize(), which is why
I turned them into Python interpreter private APIs before 3.0
shipped.

If you want a fail-safe stringified version of a Unicode object,
your only choice is to create a new API that does error checking,
properly clears the error and then returns a reference to a constant
string, e.g. "".

--
nosy: +lemburg
title: Python 3.1 segfaults when invalid UTF-8 characters are passed from 
command line -> Python 3.1 segfaults when invalid UTF-8 characters are
passed from command line

___
Python tracker 

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



[issue6734] Imap lib implicit conversion from bytes to string

2009-08-19 Thread Eric

New submission from Eric :

using imaplib IMAP4_SSL, would fail at login due to TypeError, implicit
conversion from bytes object to string around line 1068 involving
function "_quote".

My fix:  
def _quote(self, arg):
#Could not implicitly convert to bytes object to string
arg = arg.encode('utf-8') #added this line to solve problem
arg = arg.replace(b'\\', b'')
arg = arg.replace(b'"', b'\\"')

return b'"' + arg + b'"'

--
components: Library (Lib)
files: imaplib.py
messages: 91729
nosy: surprising42
severity: normal
status: open
title: Imap lib implicit conversion from bytes to string
type: behavior
versions: Python 3.1
Added file: http://bugs.python.org/file14743/imaplib.py

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Do you suggest to remove all usages of _PyUnicode_AsString() and
_PyUnicode_AsStringAndSize()?

--

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Amaury Forgeot d'Arc wrote:
> 
> Amaury Forgeot d'Arc  added the comment:
> 
> Do you suggest to remove all usages of _PyUnicode_AsString() and
> _PyUnicode_AsStringAndSize()?

In the short-term, I suggest that all uses that do not check the
return value get replaced with a new API which implements a failsafe
return value strategy.

In the mid- to long-term, the APIs should probably be removed
altogether.

They look a lot like the PyString APIs using the same names, but unlike
those APIs, they can fail, so the implied straight-forward conversion
of the PyString APIs to the above APIs gives a wrong impression to the
developers.

For error messages, I'd use the repr() of the objects - lone UTF-8
surrogates will not work since they cause issues further down the line
with debugging tools or even stderr terminal displays.

--

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The %U format seems adequate for this purpose - actually
PyObject_GenericSetAttr uses it already.

Yes, the exception message will contain the same lone UTF-8
surrogates; this is not a problem because sys.stderr uses the
"backslashreplace" error handler.

--

___
Python tracker 

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



[issue6734] Imap lib implicit conversion from bytes to string

2009-08-19 Thread R. David Murray

R. David Murray  added the comment:

See issue 1210 for background on the imaplib bytes/string issues.

A quick glance at the imaplib code leaves me confused.  _checkquote,
for example, appears to be mixing string comparisons and byte
comparisons.  Issue 1210 says imaplib _command should only quote
strings, but it does not appear at a quick glance to do any
quoting (the call to _checkquote is commented out).

It looks like the fix that would be consonant with the rest of
the code would be to convert the password to bytes using
the ASCII codec in the login method before calling _quote.

I'm adding Victor as nosy since he did the 1210 patch.

--
nosy: +haypo, r.david.murray
priority:  -> normal
stage:  -> test needed
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



[issue5114] 2.5.4.3 / test_threading hangs

2009-08-19 Thread Roger Collins

Roger Collins  added the comment:

I can confirm the same exact issue exists in python2.6 on:
Solaris 5.8 sparc

Killing the bottom process worked for me as well

--
nosy: +zulrang
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



[issue5114] 2.5.4.3 / test_threading hangs

2009-08-19 Thread Roger Collins

Roger Collins  added the comment:

Platform: Solaris 5.8 sparc
Compiler: gcc version 4.2.4

make test reported back the following on the initial test:
test test_threading failed -- Traceback (most recent call last):
  File
"/tools/webapps/local/src/Python-2.6.2/Lib/test/test_threading.py", line
419, in test_3_join_in_forked_from_thread
self._run_and_join(script)
  File
"/tools/webapps/local/src/Python-2.6.2/Lib/test/test_threading.py", line
355, in _run_and_join
self.assertEqual(data, "end of main\nend of thread\n")
AssertionError: '' != 'end of main\nend of thread\n'

**

Same type of issue further on in the testing:

test_1_join_on_shutdown (test.test_threading.ThreadJoinOnShutdown) ... ok
test_2_join_in_forked_process (test.test_threading.ThreadJoinOnShutdown)
... ok
test_3_join_in_forked_from_thread
(test.test_threading.ThreadJoinOnShutdown) ... 


$ ps -ef | grep -i 'python'
 xuserx 24669 17424  0 11:36:01 pts/18   5:44 ./python -E -tt
./Lib/test/regrtest.py -l
 xuserx 27539 27528  0 12:00:29 pts/18   0:00
/tools/webapps/local/src/Python-2.6.2/python -c if 1:import
sys, o
 xuserx 27528 24669  0 12:00:28 pts/18   0:00
/tools/webapps/local/src/Python-2.6.2/python -c if 1:import
sys, o
 xuserx 27660 29318  0 12:07:16 pts/18   0:00 grep -i python
$ kill 27539

test_3_join_in_forked_from_thread
(test.test_threading.ThreadJoinOnShutdown) ... FAIL

==
FAIL: test_3_join_in_forked_from_thread
(test.test_threading.ThreadJoinOnShutdown)
--
Traceback (most recent call last):
  File
"/tools/webapps/local/src/Python-2.6.2/Lib/test/test_threading.py", line
419, in test_3_join_in_forked_from_thread
self._run_and_join(script)
  File
"/tools/webapps/local/src/Python-2.6.2/Lib/test/test_threading.py", line
355, in _run_and_join
self.assertEqual(data, "end of main\nend of thread\n")
AssertionError: '' != 'end of main\nend of thread\n'

I'll keep digging and see if I can find a solution, but know that while
I have extensive programming experience in other languages, I have none
in python (yet).

--

___
Python tracker 

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



[issue5114] 2.5.4.3 and 2.6.2 / test_threading hangs

2009-08-19 Thread Roger Collins

Changes by Roger Collins :


--
title: 2.5.4.3 / test_threading hangs -> 2.5.4.3 and 2.6.2 / test_threading 
hangs

___
Python tracker 

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



[issue6735] restype pointer to Structure subclass never initialized

2009-08-19 Thread dontbugme

New submission from dontbugme :

So, say I'm sub-classing ctypes.Structure with a class: MyClass.

I define __init__() in MyClass..

If I explicitly instantiate MyClass(), then the __init__() is properly
executed as expected.

But say I have a CFUNCTYPE where I set it's restype member to a POINTER
to MyClass.. A python MyClass object is obviously instantiated at one
point in time, but it's __init__ is never called. Seems odd to me?

--
assignee: theller
components: ctypes
messages: 91736
nosy: dontbugme, theller
severity: normal
status: open
title: restype pointer to Structure subclass never initialized
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



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

2009-08-19 Thread Alex Quinn

Alex Quinn  added the comment:

This bug also prevents the cgi module from handling POST data with 
multipart/form-data.  Consequently, 3.x cannot be readily used to write 
web apps for uploading files.  See #4953:
   http://bugs.python.org/issue4953

--
nosy: +Alex Quinn

___
Python tracker 

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



[issue6735] restype pointer to Structure subclass never initialized

2009-08-19 Thread Thomas Heller

Thomas Heller  added the comment:

This is on purpose.

The idea is that the function call returns an existing pointer to an
existing object, so __init__ (or __new__, IIRC) is never called in this
case.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue4485] fast swap of "default" Windows python versions

2009-08-19 Thread Daniel Harding

Changes by Daniel Harding :


--
nosy: +dharding

___
Python tracker 

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Why is it desirable to have such an option?

--

___
Python tracker 

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

This makes it more easily possible for automated systems to detect that
there was a problem with the build.

Checking an exit code is easy.  Grabbing and parsing stdout and stderr
is hard and fragile.

--
nosy: +exarkun

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2009-08-19 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Please, please, please contact the email-sig and help pitch in.  For
many reasons I simply haven't had the cycles to work on this and I don't
see that happening any time soon.  There are folks willing to work on
the package in the email-sig and I will add my $0.02 with design
suggestions, but we really need manpower and motivation to get the email
package into shape.

--

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> It would be unfortunate to replace all usages of _PyUnicode_AsString to
> check the return value.

I agree with MAL: we do need to check for errors returned from
_PyUnicode_AsString, and it would be best if we created a fail-safe
version of it.

In the specific case (getattr), it might also be useful to create a
result that is unicode-escaped, i.e. with \u escapes for all non-ASCII
non-printable characters.

For _PyUnicode_AsString, I'm uncertain whether supporting half
surrogates is a good idea. Unless there is a compelling reason to
support them, I think we leave that as-is. Your example is not
compelling: I think the unicode string should be escaped, anyway.

The OP's case is also not compelling, we should print an error
message that the source code is incorrectly encoded.

--

___
Python tracker 

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> This makes it more easily possible for automated systems to detect that
> there was a problem with the build.

How do you define "problem" in this context? Why is it a problem if some
extension module did not get built? Perhaps it cannot build correctly
on this system. Is it, or is it not a problem that the module was not
built because header files were lacking that would be available, but
weren't installed on the build machine?

--

___
Python tracker 

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

If it's not a problem, then the invoker doesn't need to check the exit
code of setup.py.  Why are you resistant to exposing more information?

--

___
Python tracker 

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Guilherme Polo

Guilherme Polo  added the comment:

> If it's not a problem, then the invoker doesn't need to check the exit
> code of setup.py.

Suppose the _tkinter module failed to compile on a given system, how
would you know if this is a problem or not ? setup.py would return 1
because it couldn't be built, but the rest of Python were compiled
successfully.

--
nosy: +gpolo

___
Python tracker 

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> If it's not a problem, then the invoker doesn't need to check the exit
> code of setup.py.  Why are you resistant to exposing more information?

Because I believe that the information that is being exposed in this
patch is confusing, and will trick people into believing things that
actually don't happen. When they then try to track down the problems,
they will (then rightly) complain that the implemented behavior is
incorrect.

--

___
Python tracker 

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



[issue1550273] Fix numerous bugs in unittest

2009-08-19 Thread Ionut Turturica

Ionut Turturica  added the comment:

I keep trying to repro this on a smaller scale TestSuite but without any
success. The whole test framework has around 300 tests and I can't
really upload it.

In the mean time I changed the TestSuite's __eq__ back to identity.

I will attach the _breadth_first() method that parses the TestSuites.

--
Added file: http://bugs.python.org/file14744/test_pybug.py

___
Python tracker 

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



[issue6734] Imap lib implicit conversion from bytes to string

2009-08-19 Thread STINNER Victor

STINNER Victor  added the comment:

IMAP4 protocol uses bytes, not characters. There is no "standard
charset", so you have to encode (manually) your login and password as
bytes. login method prototype:
  IMAP4.login(login: bytes, password: bytes)

You server may use UTF-8, but another server may use ISO-8859-1 or any
other charset.

The documentation should explain why the Python library uses bytes and
not "simply" characters.

--

___
Python tracker 

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



[issue5210] zlib does not indicate end of compressed stream properly

2009-08-19 Thread Travis H.

Travis H.  added the comment:

Attaching unit test diff

Output of "diff -u test_zlib.py~ test_zlib.py"

--
Added file: http://bugs.python.org/file14745/zlib_finished_test.txt

___
Python tracker 

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

> When they then try to track down the problems, they will
> (then rightly) complain that the implemented behavior is
> incorrect.

setup.py could optionally fail immediately when building of an
extension has failed.

--

___
Python tracker 

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



[issue6736] File handling in Python

2009-08-19 Thread Salebona

New submission from Salebona :

How can I make read a text file from a normal text editor lik 
emicrosoft word or word pad?

--
components: Windows
messages: 91751
nosy: SallaS07
severity: normal
status: open
title: File handling in Python
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



[issue6737] PEP 372 odict.__eq__ behaves incorrectly

2009-08-19 Thread Christopher Egner

New submission from Christopher Egner :

The current definition for odict.__eq__ is
def __eq__(self, other):
if isinstance(other, OrderedDict):
return all(p==q for p, q in  _zip_longest(self.items(),
other.items()))
return dict.__eq__(self, other)

The current behavior of NotImplemented is:
>>> if( NotImplemented ):
... print 'foo'
foo
>>> dict.__eq__( {}, None )
NotImplemented
>>> if ( dict.__eq__( {}, None ) ):
... print 'oops'
oops

The surprising behavior is:
>>> if ( OrderedDict() != None ):
... print 'okie'
... else:
... print 'gah!'
gah!

As best I understand it, normally other (in this case None) would be
given the chance to evaluate other.__eq__( OrderedDict() ), but this
doesn't seem to be happening.

--
components: None
messages: 91752
nosy: cegner
severity: normal
status: open
title: PEP 372 odict.__eq__ behaves incorrectly
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, 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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2009-08-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

>> When they then try to track down the problems, they will
>> (then rightly) complain that the implemented behavior is
>> incorrect.
> 
> setup.py could optionally fail immediately when building of an
> extension has failed.

What about skipped extensions (i.e. those where building them was
not even attempted?)

Why is it interesting to know that building was attempted, but failed?

--

___
Python tracker 

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



[issue6737] PEP 372 odict.__eq__ behaves incorrectly

2009-08-19 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



[issue6737] PEP 372 odict.__eq__ behaves incorrectly

2009-08-19 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I cannot reproduce your final example:

Python 2.7a0 (trunk, Aug  4 2009, 12:07:15)
>>> from collections import OrderedDict
[41375 refs]
>>> if (OrderedDict() != None):
... print 'okie'
... else:
... print 'gah'
...
okie

Both are based on OrderedDict.__eq__ defined as:

def __eq__(self, other):
'''od.__eq__(y) <==> od==y.  Comparison to another OD is
order-sensitive
while comparison to a regular mapping is order-insensitive.

'''
if isinstance(other, OrderedDict):
return len(self)==len(other) and \
   all(p==q for p, q in zip(self.items(), other.items()))
return dict.__eq__(self, other)

Other questions about your bug report.  
* When you refer to odict, do you mean OrderedDict()?
* Do you understand that NotImplemented only does its magic
  in the context of the == or != operator, and it bypassed
  which you write dict.__eq__ or OrderedDict.__eq__?
* Are you clear that bool(NotImplemented) always evaluates to True?




Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> from collections import OrderedDict
>>> if (OrderedDict() != None):
... print('Okie')
... else:
... print('Gah')

Okie

Okie

--

___
Python tracker 

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



[issue6737] PEP 372 odict.__eq__ behaves incorrectly

2009-08-19 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

If you need an implementation for OrderedDict that runs on Pythons
before 2.7 or 3.1, use the recipe at:

http://code.activestate.com/recipes/576693/

That code matches what was actually added to the language.

--

___
Python tracker 

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



[issue6737] PEP 372 odict.__eq__ behaves incorrectly

2009-08-19 Thread Christopher Egner

Christopher Egner  added the comment:

I was running the odict.py file from the PEP, figured out that things
were going off the rails at dict.__eq__ and generalised, saw the same
implementation in OrderedDict, I thought the same problem would exist. 
This is what I get for taking a shortcut.

I checked out the activestate recipe mentioned in msg91755 which works.

The odict.py version, here is a literal paste from the pdb prompt (aside
from changing some of the more private data to xxx):
(Pdb) p urlConsolidationArtefact_row_prev
odict.odict([(u'id', 58768L), (u'urlConsolidationRun_id', 22L),
(u'valid', True), (u'validated', False), (u'refererUrl',
u'http://search.yahoo.com/search?y=xxx'), (u'refererUrl_hash',
'\xa60\xe2\xb8D\x7fv\x03\xb1=\xf3{\x15\xc0\xb0)'), (u'url',
u'http://xxx'), (u'url_hash',
'\x00\x00\xc8\xf3\xa3\x0f\x1d\xc2wn\xb4\xc7\xd7\xe1\xca3'),
(u'updatedAt', datetime.datetime(2009, 8, 15, 10, 54, 15)),
(u'createdAt', datetime.datetime(2009, 8, 15, 10, 54, 14))])
(Pdb) p urlConsolidationArtefact_row_prev != None
False
(Pdb) p urlConsolidationArtefact_row_prev == None
False

So there is a problem at least in the odict module provided by 
http://dev.pocoo.org/hg/sandbox/raw-file/tip/odict.py (referenced in the
PEP, once more prominently than now, I think).

Anyhow, I don't really know the details of what python does with
NotImplemented but version you gave doesn't have the same problem, so
I'll gladly use that instead.

If you can confirm that there's no deeper issue here, I'll be glad to
close the bug.

Thanks for the help!

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



[issue5210] zlib does not indicate end of compressed stream properly

2009-08-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Some comments about the patch:
- In zlibmodule.c, the is_finished member should be an int, and converted 
to a PyObject only when requested.
- The test should check that is_finished is False one byte before the 
compressed part, and becomes True when the decompressor reads the last 
compressed byte.  I don't think that dco.flush() is necessary for the 
test.
- Also, the last check could be more precise: assertEquals(y1 + y2, 
HAMLET_SCENE) and assertEquals(dco.unused_data, HAMLET_SCENE)

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6617] During compiling python 3.1 getting error Undefined symbol libintl_bind_textdomain_codeset

2009-08-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I dont know Solaris, but googling for "libintl_textdomain solaris" shows 
that many other projects have the same issue.
The solution seems to set LDFLAGS=-lintl

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6736] File handling in Python

2009-08-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The issue tracker is not a place to get help.
Please ask your question on the comp.lang.python newsgroup, there are many 
people willing to help you.

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

___
Python tracker 

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



[issue6737] PEP 372 odict.__eq__ behaves incorrectly

2009-08-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue6444] multiline exception logging via syslog handler

2009-08-19 Thread Simon Litchfield

Simon Litchfield  added the comment:

>From the manual for logging.handlers.SysLogHandler --

emit(record)
The record is formatted, and then sent to the syslog server. If
exception information is present, it is not sent to the server.

Ideal, for me, would be to have each traceback line logged as an
individual DEBUG message. Maybe that should be an option. For now I'm
using a custom handler to achieve this.

--
nosy: +s29
status: pending -> open

___
Python tracker 

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