[issue6774] socket.shutdown documentation: on some platforms, closing one half closes the other half

2012-01-12 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

 It's the other end which decides to return ENOTCONN upon shutdown(SHUT_RD) on 
 OS X, which is questionable
 (not sure it's against the BSD socket API, since shutdown(SHUT_RD) doesn't 
 have any counterpart in the TCP layer).

Exactly. The same code raises a socket.error in one platform (mac os) and not 
on another (linux). Why not document this questionable behavior?

I'm sorry, I realize that my original patch was imprecise. I'm not an expert 
here, and I simply read 
http://svn.python.org/view/python/trunk/Lib/test/test_socket.py?r1=64125r2=68611pathrev=68611
 . Ok, fine -- it doesn't close the other end per se, but shutdown(SH_RD) after 
a FIN on MacOS raises a socket.error . This is questionable, unexpected, and 
should be documented.


If possible, I'd like to push for a rewording instead of a revert.

--

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



[issue10924] Adding salt and Modular Crypt Format to crypt library.

2011-01-17 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

Hello,

1) Can you please avoid putting several statements in the same line?

2) wouldnt it be better to compute only once the contents of methods()? I'm not 
sure that module-initialization time is okay for CPython, but at the very least 
you can lazily fill a module-level variable, and return it directly from 
methods()?

3) what happens when a user uses one of the Crypt methods that are referenced 
from the Module, if this method is not available? Arguably, if I know what I'm 
doing, I will call mksalt(METHOD_SHA512) without checking that METHOD_SHA512 
was in methods(). That's not very intuitive, and it seems that mksalt could 
break.

4) saltchars should probably be string.ascii_letters+string.digits instead of 
the hardcoded value

5) you should mention in the documentation that if not salt parameter is given, 
a different salt will be used for each crypt() call

6) is _MethodClass an old-style class?

7) it seems that the patch duplicates twice the diff of crypt.py, not sure of 
what happened there?

--
nosy: +nicdumz

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



[issue1974] email.MIMEText.MIMEText.as_string incorrectly folding long subject header

2010-07-06 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

Hello folks.

(stumbling on this bug with Python2.7 release, noting that a few Mercurial 
tests broke with 2.7)

I have no problem whatsoever with the fix itself (you know emails better than 
me), but you broke backwards compatibility for email.generator.Generator here, 
without propagating the changes to previous versions.

1) It would have been nice to flag this somewhere in the release notes, and/or 
the documentation for email.generator.Generator. Finding the reason of the 
Mercurial failures was... a bit trickier than necessary :)
2) What durable solutions can you propose for those of us that have to support 
several Python versions and share a similar behaviour?

In a perfect world, I would simply do this:

class CompatibleHeader(email.Header.Header.__class__):

Python2.7 introduces a backwards incompatible change
(Python issue1974, r70772) in email.generaor.Generator code:
pre-2.7 code passed continuation_ws='\t' to the Header
constructor, and 2.7 removed this parameter.

Default argument is continuation_ws=' ', which means that
the behaviour is different in 2.7 and 2.7

We consider the 2.7 behaviour to be preferable, but need
to have an unified behaviour for versions 2.4 to 2.7

def __init__(self, **kw):
# override continuation_ws
kw['continuation_ws'] = ' '
email.Header.Header.__init__(self, **kw)

email.Header.Header.__class__ = CompatibleHeader

and get over it, but you'll notice that Header is still an old-style class... 
so that's not possible.

Any suggestions?

Thanks!

--
nosy: +djc, nicdumz

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



[issue1974] email.MIMEText.MIMEText.as_string incorrectly folding long subject header

2010-07-06 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

Sure, where was my head.

So, a simple patch like this one:

_oldheaderinit = email.Header.Header.__init__
def _unifiedheaderinit(self, *args, **kw):
# override continuation_ws
kw['continuation_ws'] = ' '
_oldheaderinit(self, *args, **kw)
email.Header.Header.__dict__['__init__'] = _unifiedheaderinit


fixes the issue for us, and might be helpful to others.

--

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



[issue6715] xz compressor support

2010-04-09 Thread Nicolas Dumazet

Changes by Nicolas Dumazet nicd...@gmail.com:


--
nosy: +nicdumz

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



[issue6005] Bug in socket example

2009-08-24 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

I'm including a patch which replaces send by sendall in the examples in
both socket and socketserver.

--
keywords: +patch
nosy: +nicdumz
Added file: http://bugs.python.org/file14776/socket.patch

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



[issue6774] socket.shudown documentation: on some platforms, closing one half closes the other half

2009-08-24 Thread Nicolas Dumazet

New submission from Nicolas Dumazet nicd...@gmail.com:

I had a bad time understanding what happens in Mac OS X after a shutdown
call: after calling shutdown(SH_WR) on side A, a corresponding
shutdown(SH_RD) on side B would raise a socket.error: socket is not
connected.
It is quite surprising when you are used to sockets in Linux, which
expect you to shut one end, and then the other one.

It turns out that under Mac OS X, a shutdown call closes the connection
on the other half. And the only mention I could find of this behavior
was here, r68611 :
http://svn.python.org/view/python/trunk/Lib/test/test_socket.py?r1=64125r2=68611pathrev=68611

I think that the documentation should specify that (surprising)
behavior: I attached a patch explaining that detail.


Thanks!

--
assignee: georg.brandl
components: Documentation
files: socketshutdown.patch
keywords: patch
messages: 91912
nosy: georg.brandl, nicdumz
severity: normal
status: open
title: socket.shudown documentation: on some platforms, closing one half closes 
the other half
type: behavior
Added file: http://bugs.python.org/file14778/socketshutdown.patch

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



[issue6775] readme: correct python.org/community/lists url

2009-08-24 Thread Nicolas Dumazet

New submission from Nicolas Dumazet nicd...@gmail.com:

README shows http://www.python.org/community/lists.html as an URL for
mailing list details, but it should be
http://www.python.org/community/lists/

Attaching a patch.

--
assignee: georg.brandl
components: Documentation
files: readme-url-mls.patch
keywords: patch
messages: 91913
nosy: georg.brandl, nicdumz
severity: normal
status: open
title: readme: correct python.org/community/lists url
Added file: http://bugs.python.org/file14779/readme-url-mls.patch

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



[issue6776] A few tests are failing when zlib is not supported

2009-08-24 Thread Nicolas Dumazet

New submission from Nicolas Dumazet nicd...@gmail.com:

test_distutils, test_zipfile, test_gzip and test_zimport are not
completely safe when zlib module is not available.

I've uploaded a patch on Rietveld which solves the issue here:
http://codereview.appspot.com/111041
Those are my first steps with Rietveld, please let me know if I can
improve something :)

Thanks,
Nicolas.

--
components: Tests
messages: 91923
nosy: nicdumz
severity: normal
status: open
title: A few tests are failing when zlib is not supported
type: behavior

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2009-08-24 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

Great, I don't know how I missed that bug.

It looks really similar to the patch I had written at
http://codereview.appspot.com/111041

So your patch looks correct to me, and does solve the issue locally.

--
nosy: +nicdumz

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



[issue5851] Add a stream parameter to gc.set_debug

2009-08-24 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

Sure, I'd be happy to contribute a patch.

I uploaded a patch on Rietveld, at http://codereview.appspot.com/110078

Let me know how it looks.

--

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



[issue6377] distutils compiler switch ignored

2009-07-09 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

It seems that the fix is still not perfect.

At the moment ( r73906 ), if you try to build trunk using Python 2.6,
you get:

 python setup.py build
running build
running build_ext
Traceback (most recent call last):
  File setup.py, line 1901, in module
main()
  File setup.py, line 1896, in main
'Lib/smtpd.py']
  File /usr/lib/python2.6/distutils/core.py, line 152, in setup
dist.run_commands()
  File /usr/lib/python2.6/distutils/dist.py, line 975, in run_commands
self.run_command(cmd)
  File /usr/lib/python2.6/distutils/dist.py, line 995, in run_command
cmd_obj.run()
  File /usr/lib/python2.6/distutils/command/build.py, line 135, in run
self.run_command(cmd_name)
  File /usr/lib/python2.6/distutils/cmd.py, line 333, in run_command
self.distribution.run_command(command)
  File /usr/lib/python2.6/distutils/dist.py, line 995, in run_command
cmd_obj.run()
  File /usr/lib/python2.6/distutils/command/build_ext.py, line 345, in run
self.build_extensions()
  File setup.py, line 103, in build_extensions
missing = self.detect_modules()
  File setup.py, line 302, in detect_modules
add_dir_to_list(self.compiler_obj.library_dirs, '/usr/local/lib')
  File /usr/lib/python2.6/distutils/cmd.py, line 112, in __getattr__
raise AttributeError, attr
AttributeError: compiler_obj

--
nosy: +nicdumz

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



[issue5851] Add a stream parameter to gc.set_debug

2009-04-27 Thread Nicolas Dumazet

New submission from Nicolas Dumazet nicd...@gmail.com:

Hello!

gc.set_debug is provided to help debugging a leaking program. That tool
can be very useful indeed. 

Debugging information, however, is written to sys.stderr, and there are
cases where this behavior can be a problem: chances are that stderr can
be already used to output other information.

Currently, to debug a verbose program writing to stderr, one has to
either first reduce/suppress the stderr output noise from its program
before activating set_debug, OR has to redirect the whole mixed stderr
output, and filter it afterwards. 

I'd like very much the possibility to configure myself where the gc
debugger will write its output.

My suggestion would be to have set_debug converted from set_debug(flags)
to set_debug(flags, stream=sys.stderr), stream being any valid file
object, but any solution allowing me to customize the output target of
the gc debugger would be welcome.

Thanks!

--
components: Extension Modules
messages: 86647
nosy: nicdumz
severity: normal
status: open
title: Add a stream parameter to gc.set_debug
type: feature request
versions: Python 2.7

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



[issue5154] OSX broken poll testing doesn't work

2009-04-14 Thread Nicolas Dumazet

Changes by Nicolas Dumazet nicd...@gmail.com:


--
nosy: +nicdumz

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