[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2011-08-07 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Here is a patch with the test for accepting the badly formed headers. I would 
like to ensure that change in the regex is fool-proof in order to accomodate 
this bad behavior, so that we don't break the existing stuff.

It is problem at the server end,I found that browsers thrown warning before 
accepting that.

--
keywords: +patch
Added file: http://bugs.python.org/file22853/issue12541.patch

___
Python tracker 

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



[issue12706] timeout sentinel in ftplib and poplib

2011-08-07 Thread Senthil Kumaran

New submission from Senthil Kumaran :

- ftplib and poplib, has them as timeout=None, while they default   

 to socket._GLOBAL_DEFAULT_TIMEOUT object.  
 

  
This is wrong; someone may pass None thinking it will trigger the   
  
default behaviour, and have nasty surprises.

--
assignee: docs@python
messages: 141740
nosy: docs@python, orsenthil
priority: normal
severity: normal
stage: needs patch
status: open
title: timeout sentinel in ftplib and poplib
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12706] timeout sentinel in ftplib and poplib documentation

2011-08-07 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
title: timeout sentinel in ftplib and poplib -> timeout sentinel in ftplib and 
poplib documentation

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-08-07 Thread Landry Breuil

Landry Breuil  added the comment:

floatobject.c is compiled with 

cc -pthread -c -fno-strict-aliasing -O2 -pipe  -Wall 
-DTHREAD_STACK_SIZE=0x2 -fPIC -O2 -pipe -Wall -I. -IInclude -I./Include   
-fPIC -DPy_BUILD_CORE -o Objects/floatobject.o Objects/floatobject.c

--

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-08-07 Thread Landry Breuil

Changes by Landry Breuil :


Added file: http://bugs.python.org/file22854/pyconfig.h

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-08-07 Thread Landry Breuil

Changes by Landry Breuil :


Added file: http://bugs.python.org/file22855/math.h

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-08-07 Thread Landry Breuil

Landry Breuil  added the comment:

Interestingly, after an update of the system i can't build python 3.2.1 anymore 
:

/usr/include/util.h:102: error: conflicting types for 'openpty'
Include/pyport.h:634: error: previous declaration of 'openpty' was here
/usr/include/util.h:105: error: conflicting types for 'forkpty'
Include/pyport.h:635: error: previous declaration of 'forkpty' was here

./Modules/posixmodule.c: In function 'posix_lstat':
./Modules/posixmodule.c:5155: error: 'lstat' undeclared (first use in this 
function)
./Modules/posixmodule.c:5155: error: (Each undeclared identifier is reported 
only once
./Modules/posixmodule.c:5155: error: for each function it appears in.)


Relevant lines of configure output (so those seem to come from systemwide 
config.site) :
checking for lstat... (cached) yes
checking for openpty... (cached) no
checking for openpty in -lutil... (cached) yes
checking for forkpty... yes

I'm attaching the generated pyconfig.h and the build log, but now that seems to 
be a different issue.. as pyconfig.h clearly contains wrong defs.

Don't count on me too much for that issue, i have honestly no interest in 
python and lost enough time on that... i trust remi to pick up on it :)

--
Added file: http://bugs.python.org/file22856/pyconfig.h.wrong

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-08-07 Thread Landry Breuil

Changes by Landry Breuil :


Added file: http://bugs.python.org/file22857/build-macppc.log

___
Python tracker 

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



[issue12191] Add shutil.chown to allow to use user and group name (and not only uid/gid)

2011-08-07 Thread Sandro Tosi

Sandro Tosi  added the comment:

grepping over the stdlib, LookupError is only used in codecs exception; also 
the documentation of LE is "The base class for the exceptions that are raised 
when a key or index used on a mapping or sequence is invalid: IndexError, 
KeyError. This can be raised directly by codecs.lookup()." so I guess it's not 
the right exception of this case.

--

___
Python tracker 

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



[issue10087] HTML calendar is broken

2011-08-07 Thread Chris Lambacher

Chris Lambacher  added the comment:

Senthil: I wasn't advocating the removal of the ability to specify encoding, 
only stating that avoiding the use of sys.stdout.buffer.write could only 
sensibly be done if we also removed the ability to specify an encoding (I can 
see how my wording might have been confusing). Earlier (msg122219) I said that 
we probably can't remove the encoding option because that would break backwards 
compatibility.

FWIW, I think that the encoding parameter to the console program is probably 
sensible because there are no guarantees that the sys.getdefaultencoding() is 
actually set to the console encoding and I would guess that most people using 
the html option are not sending output to the console anyway. They are likely 
redirecting the output somewhere else because there is no "output this to a 
file" option.

--

___
Python tracker 

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



[issue12677] Turtle, fix right/left rotation orientation

2011-08-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a30e6c4bf486 by Sandro Tosi in branch '2.7':
#12677: correct turtle orientation in doc
http://hg.python.org/cpython/rev/a30e6c4bf486

New changeset bf4f65043d7d by Sandro Tosi in branch '3.2':
#12677: correct turtle orientation in doc
http://hg.python.org/cpython/rev/bf4f65043d7d

New changeset a7365994f4d6 by Sandro Tosi in branch 'default':
#12677: merge with 3.2
http://hg.python.org/cpython/rev/a7365994f4d6

--
nosy: +python-dev

___
Python tracker 

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



[issue12677] Turtle, fix right/left rotation orientation

2011-08-07 Thread Sandro Tosi

Changes by Sandro Tosi :


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

___
Python tracker 

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



[issue10087] HTML calendar is broken

2011-08-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I don't think "WARNING: this may corrupt your terminal" is warranted. Also, I 
think we can safely remove the --encoding option. Calling a module from the 
command-line is intended as a demonstration of the module's functionality, it's 
not an official API that we have to keep compatible.

Apart from that, Chris' latest patch and Catherine's minimal test look ok to me.

--

___
Python tracker 

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



[issue5149] syntactic sugar: type coercion on pointer assignment

2011-08-07 Thread Vlad Riscutia

Vlad Riscutia  added the comment:

The main reason for this issue is that internally ctypes doesn't consider 
c_char_p as a pointer type. This is a bit counter-intuitive, but c_char_p is 
treated as a simple type and has some other sugar built-in, like easier 
integration with Python strings. Alternative pointer type is POINTER(c_char), 
which allows assignment from array.

I would make this clear in the documentation. Even now, documentation says 
following about c_char_p:

Represents the C char * datatype when it points to a zero-terminated string. 
For a general character pointer that may also point to binary data, 
POINTER(c_char) must be used. The constructor accepts an integer address, or a 
string.

So there already is a hint that c_char_p has limited use for convenience. We 
should maybe make documentation more clear. If you want equivalent of C char* 
behavior, POINTER(c_char) is the way to go.

--
nosy: +vladris

___
Python tracker 

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



[issue10741] PyGILState_GetThisThreadState() lacks a doc entry

2011-08-07 Thread Sandro Tosi

Sandro Tosi  added the comment:

Here attached a very simple patch, made by slightly re-editing the comment in 
pystate.h.

--
keywords: +patch
nosy: +ezio.melotti, sandro.tosi
stage:  -> patch review
versions: +Python 3.3 -Python 3.1
Added file: http://bugs.python.org/file22858/issue10741-default.patch

___
Python tracker 

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



[issue12191] Add shutil.chown to allow to use user and group name (and not only uid/gid)

2011-08-07 Thread R. David Murray

R. David Murray  added the comment:

Well, you could consider codecs an example in the stdlib of using it, and the 
doc could be changed to something like "stdlib modules that look up information 
in specialized data sources may raise this error directly".  Whether this is a 
good idea or not, I'm not sure, but it feels more logical than ValueError.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2011-08-07 Thread R. David Murray

R. David Murray  added the comment:

Perhaps we should issue a warning, then, too?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue10741] PyGILState_GetThisThreadState() lacks a doc entry

2011-08-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8852e4a9aa1e by Sandro Tosi in branch '2.7':
#10741: add documentation for PyGILState_GetThisThreadState()
http://hg.python.org/cpython/rev/8852e4a9aa1e

New changeset 53b8260b9ea7 by Sandro Tosi in branch '3.2':
#10741: add documentation for PyGILState_GetThisThreadState()
http://hg.python.org/cpython/rev/53b8260b9ea7

New changeset 6adfeec8c482 by Sandro Tosi in branch 'default':
#10741: merge with 3.2
http://hg.python.org/cpython/rev/6adfeec8c482

--
nosy: +python-dev

___
Python tracker 

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



[issue10741] PyGILState_GetThisThreadState() lacks a doc entry

2011-08-07 Thread Sandro Tosi

Sandro Tosi  added the comment:

I just committed an improved version of the proposed patch (thanks Ezio for the 
review and help!).

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

___
Python tracker 

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



[issue12191] Add shutil.chown to allow to use user and group name (and not only uid/gid)

2011-08-07 Thread Sandro Tosi

Sandro Tosi  added the comment:

On Mon, Aug 8, 2011 at 00:12, R. David Murray  wrote:
>
> R. David Murray  added the comment:
>
> Well, you could consider codecs an example in the stdlib of using it, and the 
> doc could be changed to something like "stdlib modules that look up 
> information in specialized data sources may raise this error directly".  
> Whether this is a good idea or not, I'm not sure, but it feels more logical 
> than ValueError.

Sure, I was just showing my line of reasoning :) I'm ok either way: if
you feel LookupError is best, I'll change shutil.chown() code and also
the doc for LE (about that, is it ok a single patch or 2 separate?)

--

___
Python tracker 

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



[issue12437] _ctypes.dlopen does not include errno in OSError

2011-08-07 Thread Vlad Riscutia

Vlad Riscutia  added the comment:

Not sure how this can be fixed actually. I don't think PyErr_SetFromErrno 
instead of PyErr_SetString would work because as far as I can tell, standard 
does not mention dlopen making use of errno. Unlike Windows, where LoadLibrary 
will change last-error, if dlopen fails, only way to retrieve error is to 
dlerror which returns a string, no error code.

--
nosy: +vladris

___
Python tracker 

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



[issue12682] Meaning of 'accepted' resolution as documented in devguide

2011-08-07 Thread R. David Murray

R. David Murray  added the comment:

Well, as long as 'accepted' is under 'resolution', I'm likely to keep using it 
for feature requests, I suppose because I'm too much of a precisonist.  If 
someone wants to re-engineer the interface, that would be fine with me :)

I personally don't mind other uses, nor do I find myself searching on 
resolutions.

--

___
Python tracker 

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



[issue12707] Deprecate addinfourl getters

2011-08-07 Thread Ezio Melotti

New submission from Ezio Melotti :

The documentation for urllib.request.urlopen [0] says that:
"""
This function returns a file-like object [addinfourl] with two additional 
methods from the urllib.response module
geturl() — return the URL of the resource retrieved, [...]
info() — return the meta-information of the page, [...]
"""

There's also a third undocumented method: getcode().  Looking at the code[1] 
ISTM that the 3 getters (geturl(), info(), and getcode()):
  1) have an inconsistent interface (why not getinfo() or getheaders()?);
  2) they just return the url, headers, and code attributes;

For these two reasons I propose to:
  * document the 3 attributes as the suggested way to access this information;
  * deprecate the 3 getters;
  * avoid to document the now undocumented getcode();


[0]: http://docs.python.org/py3k/library/urllib.request.html
[1]: Lib/urllib/response.py:83

--
components: Library (Lib)
keywords: easy
messages: 141756
nosy: ezio.melotti, orsenthil, sandro.tosi
priority: normal
severity: normal
stage: needs patch
status: open
title: Deprecate addinfourl getters
versions: Python 3.3

___
Python tracker 

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



[issue10050] urllib.request still has old 2.x urllib primitives

2011-08-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue12707] Deprecate addinfourl getters

2011-08-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

Another possible improvement that can be done is providing a proper Response 
object instead of addbase, addinfo, addinfourl (yes, those are oddly-named 
classes, not functions [0]).
The Response object could be like 'addbase', but with this signature:

class Response:
def __init__(self, fp, headers=None, url=None, code=None):
...
and without additional getters.

The addclosehook class could be provided via an alternative constructor:

@classmethod
def with_close_hook(cls, fp, hook, *hookargs):
...

[0]: Lib/urllib/response.py

--

___
Python tracker 

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



[issue1205239] Let shift operators take any integer value

2011-08-07 Thread Craig McQueen

Craig McQueen  added the comment:

So this has been rejected I see. Too bad, since I stub my metaphorical toe on 
this issue from time to time. Just for the record, here is an example:

http://stackoverflow.com/questions/4130936/perfect-hash-function/6976723#6976723

--

___
Python tracker 

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



[issue12707] Deprecate addinfourl getters

2011-08-07 Thread Nadeem Vawda

Changes by Nadeem Vawda :


--
nosy: +nadeem.vawda

___
Python tracker 

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