[issue18564] Fix Bluetooth address parser

2019-05-26 Thread Michele Orrù

Change by Michele Orrù :


--
title: Integer overflow in the socket function parsing a Bluetooth address -> 
Fix Bluetooth address parser

___
Python tracker 
<https://bugs.python.org/issue18564>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22301] smtplib.SMTP.starttls' documentation is just confusing

2014-09-01 Thread Michele Orrù

Michele Orrù added the comment:

R. David Murray rep...@bugs.python.org writes:

 Since we want to encourage people to use the context, that sounds
 reasonable for 3.x at least. 
Concerning this specific proposition, I really don't see the point in
having .starttls() not simply accepting a SSLContext as argument, as
imaplib.IMAP4.starttls is already doing, for example.

--

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



[issue22301] smtplib.SMTP.starttls' documentation is just confusing

2014-08-29 Thread Michele Orrù

New submission from Michele Orrù:

maker hello! In 
https://docs.python.org/2/library/smtplib.html#smtplib.SMTP.starttls I read::
maker If keyfile and certfile are provided, these are passed to the socket 
module’s ssl() function.
maker socket.ssl() exists, though it is not documented (not even in 
/dev/library/socket)
maker and furthermore, the link on ssl() points to the ssl module, which is 
just confusing.
bitdancer maker: open an issue.

(I'm noising ap and chris because afaik they were working on the latest ssl 
security stuff)

--
assignee: docs@python
components: Documentation, Library (Lib), email
messages: 226074
nosy: barry, christian.heimes, docs@python, maker, pitrou, r.david.murray
priority: normal
severity: normal
status: open
title: smtplib.SMTP.starttls' documentation is just confusing
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue14261] Cleanup in smtpd module

2014-06-30 Thread Michele Orrù

Michele Orrù added the comment:

On Sun, Jun 29, 2014 at 03:15:44PM +, Mark Lawrence wrote:

 Mark Lawrence added the comment:

 @Michele as 8739 has been implemented would you like to put up a patch for 
 this?
No, but setting keyword easy could help for future contributions.

--

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



[issue18564] Integer overflow in socketmodule

2014-06-10 Thread Michele Orrù

Michele Orrù added the comment:

ping.

--

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



[issue21541] Provide configure option --with-ssl for compilation with custom openssl

2014-05-21 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue18564] Integer overflow in socketmodule

2014-05-03 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file35146/issue18564.3.patch

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



[issue18564] Integer overflow in socketmodule

2014-05-03 Thread Michele Orrù

Michele Orrù added the comment:

Interestingly, bluetooth/bluetooth.h implements a function for parsing 
bluetooth addresses, but it's completely broken.
https://git.kernel.org/cgit/bluetooth/bluez.git/tree/lib/bluetooth.c#n83 
It would be much much more elegant to use str2ba() in our source code though.

I am thinking about patching it there and then open another ticket here in 
order to adopt str2ba(). This way we can close this ticket for now.
Does this sound reasonable to you, Antoine?

--

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



[issue18564] Integer overflow in socketmodule

2014-04-30 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file35112/issue18564.2.patch

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



[issue8402] Add a function to escape metacharacters in glob/fnmatch

2013-11-17 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy:  -maker

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



[issue16113] SHA-3 (Keccak) support may need to be removed before 3.4

2013-10-24 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy:  -maker

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



[issue16201] socket.gethostbyname incorrectly parses ip

2013-08-29 Thread Michele Orrù

Michele Orrù added the comment:

Cool, thanks for pointing the correct library function. 

Tested on my machine - Debian 3.9 x86_64 GNU/Linux.

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-29 Thread Michele Orrù

Michele Orrù added the comment:

 Is that you actual use case? That you *want* to store binary data in XML, 
 instead of getting it properly rejected as non well-formed content?
No, Stefan.

What I was saying in my last message was  just you're right, the user shall 
always use repr() when printing an xml tree (msg196313) because xml does 
*not* guarantee to have only printable chars by itself (msg196368, msg196379).

As an advice I hope you do not take as insult, saying
in section {section} the spec says {argument} 
is much more constructive than 
read the spec on that, {extremely_obvious_link},
at least to people not familiar with the spec and asking for the source of your 
arguments (msg196360). Can shorten threads, too.

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-28 Thread Michele Orrù

Michele Orrù added the comment:

 The parser *is* rejecting control characters. It's an XML parser. See the 
 example in the link you posted.
Ehrm, my apologies.

 That's not an XML specific issue. You are printing a byte string here, so 
 repr() would be the right thing to use (and is actually being used 
 automatically in 
 Py3), instead of plain printing. The fact that you are wrapping the content 
 in XML doesn't matter.
[citation needed] 
After a quick scan in the documentation I did not see anything mentioning this. 
Instead, I see many cases in which escape chars and binary-to-text encodings 
are mentioned.

 What I meant was: at what step of the process from creating an XML tree in 
 memory to serialisation is it a problem that the tree contains control 
 characters? 
 Because once the data is serialised, it will just be rejected on input by any 
 XML parser, and handling bytes data is a thing on its own (e.g. you could 
 serialise 
 to UTF16 and the result would contain null bytes - too bad).
m, I think the problem lies in the expectation of having 
fromstring(tostring(tree)) = tree

 Unless there is a more dangerous way to exploit this that is actually due to 
 XML being used, I'd suggest changing the type from security back to 
 behaviour.
 Or maybe even to enhancement. The behaviour that it writes out what you 
 give it isn't exactly wrong, it's just inconvenient that you have to take 
 care yourself 
 that you pass it well-formed XML content.
I think the point here is clarifying whether xml expect text or just a byte 
string. In case that's a stream of byte, I agree with you, is more a 
behaviour problem.

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-28 Thread Michele Orrù

Michele Orrù added the comment:

 Incidentally I read today 
 http://blastedbio.blogspot.co.uk/2012/05/blast-tabular-missing-descriptions.html
  mentioning ^A being used. 
 Maybe that would stop working?
I don't see any problem in any xml output. Indeed:
You can't put a nasty non-printing ASCII character in XML, so they were 
switched to something else. That is my working theory for this anyway.

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-28 Thread Michele Orrù

Michele Orrù added the comment:

 XML is *defined* as a stream of bytes.
Can you *paste* the *source* proving what you are arguing, please?  

 Regarding the API side in ElementTree, Py2 accepts byte strings and Py3 
 requires Unicode strings.
accepts? python3 works with ElementTree(bytes(unicode))

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-28 Thread Michele Orrù

Michele Orrù added the comment:

 XML is *defined* as a stream of bytes.
 Can you *paste* the *source* proving what you are arguing, please?
 http://www.w3.org/TR/REC-xml/

The first two suggestions are directly derived from the rules given for 
identifiers in Standard Annex #31 (UAX #31) of the Unicode Standard, version 
5.0 [Unicode], and exclude all control characters, enclosing nonspacing marks, 
non-decimal numbers, private-use characters, punctuation characters (with the 
noted exceptions), symbol characters, unassigned codepoints, and white space 
characters. The other suggestions are mostly derived from Appendix B in 
previous editions of this specification.


--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-28 Thread Michele Orrù

Michele Orrù added the comment:


Document authors are encouraged to avoid compatibility characters, as defined 
in section 2.3 of [Unicode]. The characters defined in the following ranges are 
also discouraged. They are either control characters or permanently undefined 
Unicode characters:


--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-28 Thread Michele Orrù

Michele Orrù added the comment:

Does not seem to me just a byte string where you can put binary data. 
Hence, I expect the xml tree to escape/reject those. 
Hence, Is not an enhancement, but a bug. Unless we just want to document this.

(not going to change the metadata, otherwise we'll end up changing on each 
message).

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-28 Thread Michele Orrù

Michele Orrù added the comment:

I said that (serialised) XML is defined as a sequence of bytes. 
 Read the spec on that.
And I'm saying that's inexact. I have expectations that control chars are 
escaped in the serialized xml, because the spec I'm reading says so, and 
because the documentation does not warn me about this.

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-28 Thread Michele Orrù

Michele Orrù added the comment:

Just pointed by a friend - http://www.w3.org/TR/REC-xml/#sec-cdata-sect
I suppose this is insanely used to put binary blobs inside xml until only the 
CDEnd string is recognized as markup.
That's what I needed. 

Amen.

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-27 Thread Michele Orrù

New submission from Michele Orrù:

Got from irc; 
JerryKwan python bug in xml.etree.ElementTree, from version 2.7 to 3.2 
http://www.reddit.com/r/Python/comments/1l6cta/python_bug_in_xmletreeelementtree/

I think we should keep consistency with lxml and forbid control chars in 
advance. 
https://en.wikipedia.org/wiki/Valid_characters_in_XML#XML_1.1

Attaching the test file proving the issue, slightly modified to work on 2.7 and 
3.x

--
files: test.py
messages: 196271
nosy: maker
priority: normal
severity: normal
status: open
title: xml.etree.ElementTree accepts control chars.
Added file: http://bugs.python.org/file31482/test.py

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-27 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
components: +Library (Lib), XML
type:  - behavior

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-27 Thread Michele Orrù

Michele Orrù added the comment:

you mind if I try by myself to provide patch and unittest in the next few days?

--

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-27 Thread Michele Orrù

Michele Orrù added the comment:

I suppose it is, David, if in 2 minutes flat I can change your terminal name.

--
Added file: http://bugs.python.org/file31484/inject.py

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



[issue18850] xml.etree.ElementTree accepts control chars.

2013-08-27 Thread Michele Orrù

Michele Orrù added the comment:

 Michele, could you elaborate how you would exploit this issue as a security 
 risk?
Sure. What I meant in my message is: assume you have a script that simply 
stores each message it receives (from stdin, from a tcp stream, whatever) 
inside an xml tree like 
'text{message1}/texttext{message2}text',
and prints the tree on SIGINT.

What I would expect is the xml document not to allow control chars, as 
restricted and discouraged, and consistent with lxml. 
What instead happens is that the control chars are not handled, and thus 
anybody can send control chars in my terminal. Changing the terminal title is a 
trivial example of those. 

For sure an echo server may have the same issue, but the premises are 
different, because I expect to print just a byte stream.
Mentioning this fact in the documentation may be a possible solution, but I 
believe more that keeping consistency with lxml is the right way.

 I mean, I can easily create a (non-)XML-document with control characters 
 manually, and the parser would reject it.
False? The parser is *not* rejecting control chars.
 
 What part of the create-to-serialise process exactly is a problem here?
ElementTree.tostring().

--

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



[issue16201] socket.gethostbyname incorrectly parses ip

2013-08-27 Thread Michele Orrù

Michele Orrù added the comment:

Ping.

--

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



[issue18564] Integer overflow in socketmodule

2013-08-27 Thread Michele Orrù

Michele Orrù added the comment:

Ping.

--

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



[issue16083] HTTPServer does not correctly handle bad request line

2013-08-27 Thread Michele Orrù

Michele Orrù added the comment:

Still is an issue, though. Exported on the current tip.

--
versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file31486/issue16083.1.patch

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



[issue18564] Integer overflow in socketmodule

2013-08-27 Thread Michele Orrù

Michele Orrù added the comment:

oops, didn't see :) thanks.

--

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



[issue18538] `python -m dis ` should use argparse

2013-08-24 Thread Michele Orrù

Michele Orrù added the comment:

Ping.

--

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2013-07-27 Thread Michele Orrù

Michele Orrù added the comment:

ping.

--

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



[issue18564] Integer overflow in socketmodule

2013-07-27 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file31056/issue18564.1.patch

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



[issue18564] Integer overflow in socketmodule

2013-07-26 Thread Michele Orrù

New submission from Michele Orrù:

In Modules/socketmodule.c , the bluetooth address supplied is vulnerable to 
integer overflow.

Attaching patch and a couple of tests, which should be considered as a step 
forward in #7687.

--
components: Extension Modules
files: btoverflow.patch
keywords: patch
messages: 193736
nosy: maker
priority: normal
severity: normal
status: open
title: Integer overflow in socketmodule
type: behavior
Added file: http://bugs.python.org/file31041/btoverflow.patch

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



[issue18538] `python -m dis `

2013-07-23 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
components: Library (Lib)
nosy: maker
priority: normal
severity: normal
status: open
title: `python -m dis `
type: enhancement
versions: Python 3.5

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



[issue18538] `python -m dis ` relying on argparse

2013-07-23 Thread Michele Orrù

New submission from Michele Orrù:

I feel a little bit embarassed for this patch;
while reading the stdlib's Lib/dis.py file, I saw that the _test() function 
parses by itself sys.argv. 

I tried to clean it up using argparse; diff and manual tests attached.

--
title: `python -m dis ` - `python -m dis ` relying on argparse
Added file: http://bugs.python.org/file31023/issue18538.log

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



[issue18538] `python -m dis ` relying on argparse

2013-07-23 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file31024/issue18538.patch

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



[issue18233] SSLSocket.getpeercertchain()

2013-07-05 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue18369] X509 cert class for ssl module

2013-07-05 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2013-05-01 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue14364] Argparse incorrectly handles '--'

2013-04-19 Thread Michele Orrù

Michele Orrù added the comment:

wow, I was just writing the unittests, thanks paul. 
Shall I continue? I don't see any test case on tip.

--

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



[issue13922] argparse handling multiple -- in args improperly

2013-04-19 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue14364] Argparse incorrectly handles '--'

2013-04-19 Thread Michele Orrù

Michele Orrù added the comment:

Yes, http://bugs.python.org/file29845/dbldash.patch seems to fix this.
Attaching the unittests, and noisying on your issue.

--
keywords: +patch
Added file: http://bugs.python.org/file29938/issue14364.test.patch

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-03-26 Thread Michele Orrù

Michele Orrù added the comment:

.. sorry for all these trivialities.

--
Added file: http://bugs.python.org/file29584/issue16692.3.patch

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-03-26 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file29587/issue16692.4.patch

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-03-20 Thread Michele Orrù

Michele Orrù added the comment:

synced with tip

 This decorator looks like it would be impressed in a simpler way,
 using unittest.skipIf (or unittest.skipUnless).

 It would be nice to check that connecting succeeds from a
 TLSv1_1 client on a SSLv23 server.

yep, thanks.


 Not sure why you test only with OP_NO_TLSv1_1.
I've just emulated older tests against older TSL protocols. Is there anything 
wrong you see? 


PS: I have removed ssl.PROTOCOL_* from test_constants, since they are already 
used in the global variable PROTOCOLS.

--
Added file: http://bugs.python.org/file29501/issue16692.2.patch

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-03-16 Thread Michele Orrù

Michele Orrù added the comment:

(ping)

--

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



[issue17267] datetime.time support for '+' and 'now'

2013-02-23 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue15767] add ModuleNotFoundError

2013-02-18 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy:  -maker

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



[issue979407] urllib2 digest auth totally broken

2013-02-15 Thread Michele Orrù

Michele Orrù added the comment:

Isn't this issue fixed and tested on Lib/test/test_urllib2.py:1304?

--
nosy: +maker

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-02-13 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +eric.araujo

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-02-13 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file29066/issue16692.1.patch

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



[issue16692] Support TLS 1.1 and TLS 1.2

2013-02-09 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
keywords: +patch
nosy: +maker
Added file: http://bugs.python.org/file29022/issue16692.patch

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



[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue6584] gzip module has no custom exception

2012-11-10 Thread Michele Orrù

Michele Orrù added the comment:

done!

--
Added file: http://bugs.python.org/file27943/issue6584_6.patch

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



[issue6584] gzip module has no custom exception

2012-11-10 Thread Michele Orrù

Michele Orrù added the comment:

Well, I specified the word ``files`` everywhere for that reason. Looking at 
Doc/library/zlib.rst I see:

  For reading and writing .gz files see the gzip module.

Also, I specified 'the gzip module' on the whatsnew section.
Is there anything more specific I could have done?

--

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



[issue16236] Doc/Makefile should have $PYTHON=python2

2012-10-20 Thread Michele Orrù

Michele Orrù added the comment:

 The patch should not unconditionally use `python2` since many distributions 
 do not yet install a `python2` link 
 to the interpreter nor is there one when running python2.7 from a build 
 directory.  The Makefile could 
 conditionally try `python2` and then fall back to `python`.
Sorry, I did not know that some OSes could not have the `python2` symlink, I 
just watched if there was on the Makefile. 


 Yes, please don’t break many OSes for the sake of one.

Concerning this, we should do a proper configure script. Do you think that's 
worth it, E`ric?  
```
Real configure scripts are generally much more complicated than this, since 
they may deal with systems where $PATH is not delimited by colons; or systems 
where executable programs may have optional extensions like .EXE; or $PATH 
variables that have the current working directory included in them as an empty 
string; etc. 

-- http://mywiki.wooledge.org/BashFAQ/081

--

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



[issue5256] rlcompleter adds builtins when custom dict is used

2012-10-15 Thread Michele Orrù

Michele Orrù added the comment:

Updated. Note that removing `eval` is necessary for the new logic of the 
function.

--
Added file: http://bugs.python.org/file27586/issue5256.1.patch

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



[issue16083] HTTPServer does not correctly handle bad headers

2012-10-14 Thread Michele Orrù

Michele Orrù added the comment:

Well, it is a security issue IMO, but not particularly harmful. But certainly 
that's not a RFC violation, since I'm not sending rfc-compliant packets.[0]  

The best an attacker could do is to DDoS the server running HTTPServer: 
tracebacks may open file descriptors and/or send emails to the sysadmin, and 
hence the attacker could flood the server opening new file descriptors, or the 
email box.[0]
At least, this is the worst thing that came to my mind discussing with exarkun. 

[0] https://twistedmatrix.com/trac/ticket/6029

--

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



[issue5256] rlcompleter adds builtins when custom dict is used

2012-10-14 Thread Michele Orrù

Michele Orrù added the comment:

Updated with tip, and merged with documentation.

--
Added file: http://bugs.python.org/file27569/issue5256.patch

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



[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-14 Thread Michele Orrù

Michele Orrù added the comment:

Noblesse oblige :)

--
Added file: http://bugs.python.org/file27570/issue8402.1.patch

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



[issue16236] Doc/Makefile should have $PYTHON=python2

2012-10-14 Thread Michele Orrù

New submission from Michele Orrù:

On Arch/Linux, running `make html` fails with

$ make html
mkdir -p build/html build/doctrees
python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size=  . 
build/html 
Traceback (most recent call last):
  File tools/sphinx-build.py, line 27, in module
from sphinx import main
  File //cpython/Doc/tools/sphinx/__init__.py, line 44
except ImportError, err:
  ^
SyntaxError: invalid syntax
make: *** [build] Error 1

That is because sphinx needs python version 2 to run; but `python` is symlinked 
to python3 on my platform. We should replace $PYTHON with python2, which AFAIS 
here[0], it would point to the correct version.

[0] http://hg.python.org/cpython/file/5fc6f47974db/Makefile.pre.in#l808

--
components: Interpreter Core
messages: 172931
nosy: maker
priority: normal
severity: normal
status: open
title: Doc/Makefile should have $PYTHON=python2
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue16236] Doc/Makefile should have $PYTHON=python2

2012-10-14 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file27576/issue16236.patch

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



[issue16236] Doc/Makefile should have $PYTHON=python2

2012-10-14 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
assignee:  - docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-13 Thread Michele Orrù

Michele Orrù added the comment:


 Buggy due to the use of scanf at Modueles/socketmodule.c:868

 I don't think so. The following test fails because sscanf() returns 5
 instead of 4:
You are right, sorry for didn't notice. 


 If you consider that '192.168.1.1  ' is an invalid name, you should
 report the issue to the vendor of the C library of your OS.
Yep, I'm going to ask on #glibc if there is any specific reason for accepting 
trailing spaces. But this concerns the specific underlying implementation if 
getaddrinfo(), so IMO we should just update the int overflow issue for now, 
maintaining the coherence with other utilities having the same problem. For 
this, I am attaching a new patch which which just do not test for trailing 
whitespaces. 

-- 
ù

--
Added file: http://bugs.python.org/file27549/issue16201.1.patch

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-13 Thread Michele Orrù

Michele Orrù added the comment:

Reviewed with Ezio.

--
Added file: http://bugs.python.org/file27550/issue16201.2.patch

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



[issue8402] glob returns empty list with [ character in the folder name

2012-10-13 Thread Michele Orrù

Michele Orrù added the comment:

The attached patch adds support for '\\' escaping to fnmatch, and consequently 
to glob.

--
keywords: +patch
nosy: +maker
versions: +Python 3.4 -Python 3.2
Added file: http://bugs.python.org/file27551/issue8402.patch

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-13 Thread Michele Orrù

Michele Orrù added the comment:

Updated  tested on GNU/Linux (gcc).

--
Added file: http://bugs.python.org/file27558/issue16201.3.patch

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-12 Thread Michele Orrù

Michele Orrù added the comment:

 Attaching patch to trim leading and trailing whitespaces prior to
 processing.
Note that tests are incorrect: the parsing is of the form %d.%d.%d.%d%c, so the 
parser should accept trailing spaces. That's the same for ping iirc: 

$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.

--- 192.168.1.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms

$ ping  192.168.1.1
ping: unknown host  192.168.1.1


I am trying to get out with a simple parser inside the function, probabl y 
strtol() is the way. 
 Since Python's C API does not provide any sscanf wrapper, I thought about 
adding a new one. But given that, AFAIS it appears just two times over the 
entire sourcecode, there is no need IMO for exporting a new one right now. What 
is your opinion?

--
nosy: +ezio.melotti

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-12 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file27540/issue16201.patch

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



[issue16201] socket.gethostbyname incorrectly parses ip

2012-10-11 Thread Michele Orrù

New submission from Michele Orrù:

Buggy due to the use of scanf at Modueles/socketmodule.c:868
Broken from python2.7 to tip on my machine (GNU/Linux)

 import socket
[64481 refs]
 socket.gethostbyname('4294967306.4294967296.4294967296.1')
'10.0.0.1'
[67764 refs]
 socket.gethostbyname('192.168.1.1  ')
'192.168.1.1'
[67764 refs]
 socket.gethostbyname('  192.168.1.1')
'192.168.1.1'
[67764 refs]
 socket.gethostbyname('  192.168.1.1  ')
Traceback (most recent call last):
  File stdin, line 1, in module
socket.gaierror: [Errno -2] Name or service not known
[67805 refs]

--
components: Library (Lib)
messages: 172682
nosy: maker
priority: normal
severity: normal
status: open
title: socket.gethostbyname incorrectly parses ip
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue16184] Attack against the pseudorandom number generator

2012-10-10 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue13290] get vars for object with __slots__

2012-10-06 Thread Michele Orrù

Michele Orrù added the comment:

As a reference, linking the discussion on python-dev. 
http://mail.python.org/pipermail/python-dev/2012-October/122011.html

--

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



[issue15767] add ModuleNotFoundError

2012-10-06 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue16149] Decimal(2) != float(2) documentation bug

2012-10-06 Thread Michele Orrù

New submission from Michele Orrù:

Follows from the discussion on python-dev:
http://mail.python.org/pipermail/python-dev/2012-September/121871.html

--
assignee: docs@python
components: Documentation
messages: 172182
nosy: docs@python, maker, terry.reedy
priority: normal
severity: normal
status: open
title: Decimal(2) != float(2) documentation bug
versions: Python 3.3, Python 3.4

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



[issue16113] Add SHA-3 (Keccak) support

2012-10-06 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue16009] Json error messages could provide more information about the error

2012-10-04 Thread Michele Orrù

Michele Orrù added the comment:

Since AFAIK json.loads runs through every simil-str object, I think that a 
repr() is fine here. What do you think?

--
nosy: +maker

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



[issue16009] Json error messages could provide more information about the error

2012-10-04 Thread Michele Orrù

Michele Orrù added the comment:

 A repr of what?
Of the variable s in Lib/json/decoder.py#l358

--

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



[issue16009] Json error messages could provide more information about the error

2012-10-04 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file27415/issue16009.patch

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



[issue13290] get vars for object with __slots__

2012-10-03 Thread Michele Orrù

Michele Orrù added the comment:

Patch + unittests + documentation attached.

$ ./python -m test -R 3:2 test_builtin
[1/1] test_builtin
beginning 5 repetitions
12345
.
1 test OK.
[158296 refs]

--
keywords: +patch
nosy: +maker
Added file: http://bugs.python.org/file27395/issue13290.patch

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



[issue13290] get vars for object with __slots__

2012-10-03 Thread Michele Orrù

Michele Orrù added the comment:

 The patch does not seem to walk the mro to look for slots in base 
 classes.  Also, an instance with a __dict__ attribute may also have 
attributes stored in slots.
Well, what I am doing is more or less the equivalent of 

return object.__slots__ if hasattr(object, '__slots') else object.__dict__

and this is coherent with the updated documentation. The one you proposed is an 
alternative behavior; am I supposed to follow that one?


 BTW, copyreg._slotnames(cls) properly calculates the slot names for cls and 
 tries to cache them as cls.__slotnames__.  Pickle does the equivalent of

 try:
 slotnames = cls.__slotnames__
 except AttributeError:
 slotnames = copyreg._slotnames(cls)
thanks! I'll take into account. 

-- 
ù

--

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



[issue16106] antigravity tests

2012-10-02 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue16081] Fix compile warnings in thread_pthread.h

2012-09-30 Thread Michele Orrù

Michele Orrù added the comment:

That's ok for me.
Tested with OSX 10.8 and clang.

--
nosy: +maker

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



[issue1052827] filelist.findall should not fail on dangling symlinks

2012-09-30 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

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



[issue14679] Define an __all__ for html.parser

2012-09-28 Thread Michele Orrù

Michele Orrù added the comment:

# Internal appears only in HTMLParser's methods; how could __all__ fix this?

--
nosy: +maker

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



[issue16083] HTTPServer does not correctly handle bad headers

2012-09-28 Thread Michele Orrù

New submission from Michele Orrù:

Sending a GET /\0 causes a TypeEror to be raised and the connection to be 
unexpectedly closed. 

$ python -m SimpleHTTPServer 8000
$ printf GET /\00 | nc localhost 8000

TypeError: must be encoded string without NULL bytes, not str


I think raising a 400 error should be fine. Also, shouldn't the error message 
contain a repr(string)?

[From http://corte.si/posts/code/pathod/pythonservers/index.html]

--
components: Library (Lib)
messages: 171435
nosy: maker
priority: normal
severity: normal
status: open
title: HTTPServer does not correctly handle bad headers
type: security
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue16083] HTTPServer does not correctly handle bad headers

2012-09-28 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +exarkun

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



[issue16083] HTTPServer does not correctly handle bad headers

2012-09-28 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy:  -exarkun

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



[issue16083] HTTPServer does not correctly handle bad headers

2012-09-28 Thread Michele Orrù

Michele Orrù added the comment:

Note: on python3, the error is 
  File /[...]/cpython/Lib/genericpath.py, line 41, in isdir
st = os.stat(s)
TypeError: embedded NUL character
(same exception but different message.)

I don't know where to start fixing, because the documentation for os.stat says 
Perform the equivalent of a stat() system call on the given path., which is 
not exactly the correct behavior in this case.

I see that 
$ printf /\00 | xargs stat
stat()s correctly the root directory, and
$ printf /\00tmp | xargs stat
stat()s still '/'. So, is this a bug of os.stat?

Noising some coredevs.

--
nosy: +eric.araujo, ezio.melotti, r.david.murray

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



[issue16083] HTTPServer does not correctly handle bad headers

2012-09-28 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file27337/issue16083.patch

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



[issue16083] HTTPServer does not correctly handle bad headers

2012-09-28 Thread Michele Orrù

Michele Orrù added the comment:

Attaching tests that asserts the issue, and a patch for http.server. 
Works on tip.
Should be ported also to 2.x?

Note: that 'f = None' is unnecessary, maybe an isolated commit for that?

--
keywords: +patch
Added file: http://bugs.python.org/file27336/issue16083.tests.patch

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file27293/bench.py

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù

Michele Orrù added the comment:

Updated.

tumbolandia:cpython maker$ hg import --no-commit -f issue8425.2.patch  make 
-j3 /dev/null 2/dev/null
sto applicando issue8425.2.patch
tumbolandia:cpython maker$ ./python.exe bench.py starting...
setting up tests...
testing...
big_timer_no_intersection 0.000546158852762
big_timer_subtraction 382.0618862710003
small_timer 0.0034195990001535392
big_timer 603.510513244
std_timer_subtraction 0.000686513778934
big_timer_reversed 292.4404268074
std_timer 8.092500047496287e-05
[44705 refs]
tumbolandia:cpython maker$ hg co -C  make -j3 /dev/null 2/dev/null1 files 
updated, 0 files merged, 0 files removed, 0 files unresolved
tumbolandia:cpython maker$ ./python.exe bench.py 
starting...
setting up tests...
testing...
big_timer_subtraction 611.292889542
big_timer 465.6846392586
small_timer 0.00261835360109
big_timer_reversed 256.5112134430001
std_timer 0.00011092699969594833
big_timer_no_intersection 0.0005648139995173551
std_timer_subtraction 2.861284273945e-05
[44705 refs]

--
Added file: http://bugs.python.org/file27292/issue8425.2.patch

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù

Michele Orrù added the comment:

 I'm not sure of the usefulness of this comment.
removing, then.

 else redundant here.

 Instead of using a local variable intersected, you can simply add else
 Py_INCREF(other) here and then decref other unconditionally. It will be
 shorter and perhaps a little clearer, but a bit slower.

I find my first patch more readable and efficient, but if these comments are 
conformant to pep7.. 
Attaching updated patch (issue8425.3.patch)


 Did you run benchmarks in debug mode?
Yes, but bench.py is available, fell free to run it with whatever 
configuration; my example was done with a --with-pydebug and clang compiler. 

 In order for results to be convenient to compare please sort it by name.
Done.

--
Added file: http://bugs.python.org/file27303/issue8425.3.patch

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù

Michele Orrù added the comment:

 I'm not sure of the usefulness of this comment.
removing, then.

 else redundant here.

 Instead of using a local variable intersected, you can simply add else
 Py_INCREF(other) here and then decref other unconditionally. It will be
 shorter and perhaps a little clearer, but a bit slower.

I find my first patch more readable and efficient, but if these comments are 
conformant to pep7.. 
Attaching updated patch (issue8425.3.patch)


 Did you run benchmarks in debug mode?
Yes, but bench.py is available, fell free to run it with whatever 
configuration; my example was done with a --with-pydebug and clang compiler. 

 In order for results to be convenient to compare please sort it by name.
Done.

--
Added file: http://bugs.python.org/file27305/issue8425.3.patch

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Removed file: http://bugs.python.org/file27293/bench.py

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-25 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


Added file: http://bugs.python.org/file27306/bench.py

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Michele Orrù

Michele Orrù added the comment:

Reviewed with Ezio.

--
Added file: http://bugs.python.org/file27272/issue8425.1.patch

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Michele Orrù

Michele Orrù added the comment:

woops, sry. Re-posting the benchmark, with three tests: the first one proposed 
(@abacabadabacaba) with very large sets; another one with smaller sets.

$ ./python.exe -m timeit  -n 100 -s s= set(range(2000)); l = 
set(range(2000))   s-=l
100 loops, best of 3: 9.71 usec per loop
[48787 refs]

$ ./python.exe -m timeit  -n 100 -s s= set(range(1)); l = set(range(20))   
s-=l
100 loops, best of 3: 0.366 usec per loop


$ hg co -C
$ make -j3

[!PATCHED]--
$ ./python.exe -m timeit  -n 100 -s s= set(range(2000)); l = 
set(range(2000))   s-=l
100 loops, best of 3: 665 msec per loop
[48787 refs]

$ ./python.exe -m timeit  -n 100 -s s= set(range(1)); l = set(range(20))   
s-=l
100 loops, best of 3: 0.849 usec per loop
[48787 refs]

--

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Michele Orrù

Michele Orrù added the comment:

What do you mean by does not preserve set identity? Because I see: 

$ ./python.exe
Python 3.3.0rc2+ (default:178f9042af81+, Sep 24 2012, 18:54:31) 
[GCC 4.2.1 Compatible Apple Clang 2.1 (tags/Apple/clang-163.7.1)] on darwin
Type help, copyright, credits or license for more information.
 a = set(range(1))
[65967 refs]
 b = set(range(20))
[65989 refs]
 id(a)
4540421032
[65992 refs]
 a -= b
[65991 refs]
 id(a)
4540421032

--

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



  1   2   >