[issue9981] let make_buildinfo use a temporary directory on windows

2010-09-29 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson krist...@ccpgames.com:

make_buildinfo currently creates temporary files getbuildinfo2.c and 
getbuildinfo.o in the current build directory.  This update allows the caller 
to specify a temp directory to put those files in.
The PCBuild pythoncore.vcproj now makes use of this, to put the.c and .o files 
in the current temporary directory $(IntDir).

This makes it possible to compile multiple project configurations in parallel, 
with tools such as incredibuild, without fearing that each will trample the 
other's getbuildinfo files.

Also removed an unnecessary 64 bit config for make_buildinfo.

--
components: Interpreter Core
messages: 117576
nosy: krisvale
priority: normal
severity: normal
status: open
title: let make_buildinfo use a temporary directory on windows
type: compile error
versions: Python 2.7

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



[issue9979] Create PyUnicode_AsWideCharString() function

2010-09-29 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

STINNER Victor wrote:
 
 New submission from STINNER Victor victor.stin...@haypocalc.com:
 
 PyUnicode_AsWideChar() doesn't merge surrogate pairs on a system with 32 bits 
 wchar_t and Python compiled in narrow mode (sizeof(wchar_t) == 4 and 
 sizeof(Py_UNICODE) == 2) = see issue #8670.
 
 It is not easy to fix this problem because the callers of 
 PyUnicode_AsWideChar() suppose that the output (wide character) string has 
 the same length (in character) than the input (PyUnicode) string (suppose 
 that sizeof(wchar_t) == sizeof(Py_UNICODE)). And PyUnicode_AsWideChar() 
 doesn't write nul character at the end if the output string is truncated.
 
 To prepare this change, a new PyUnicode_AsWideCharString() function would 
 help because it does compute the size of the output buffer (whereas 
 PyUnicode_AsWideChar() requires the output buffer in an argument).

Great idea !

--

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



[issue9980] str(float) failure

2010-09-29 Thread John Machin

Changes by John Machin sjmac...@users.sourceforge.net:


--
nosy: +sjmachin

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



[issue9980] str(float) failure

2010-09-29 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +eric.smith, mark.dickinson

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



[issue9979] Create PyUnicode_AsWideCharString() function

2010-09-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

+1 from me as well.
But shouldn't PyUnicode_AsWideCharString() merge surrogate pairs when it can? 
The implementation doesn't do this.

--
nosy: +amaury.forgeotdarc

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



[issue9980] str(float) failure

2010-09-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

This sounds similar to issue 9215, which was due to a compiler optimization 
bug.  Certainly it points to something going wrong in _Py_dg_dtoa.

What platform are these results from?

Do you have minimal code that can be used to reproduce?

I'm surprised that 3.2 fixes this:  the float-to-string conversion code is 
pretty much identical in both 3.1 and 3.2.

--

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



[issue9980] str(float) failure

2010-09-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 I'm surprised that 3.2 fixes this:  the float-to-string conversion code  is 
 pretty much identical in both 3.1 and 3.2.

Whoops---not quite.  The conversion code *is* pretty much identical, but 3.2 
now uses a different algorithm for str (it's equal to repr now).  So I'd expect 
that you'll see the issue in 3.2 too if you try something like

'%.12g' % 38210.0

Kiriakos, can you explain a bit more what the difference is between the 'remote 
engine' and the 'stand along interpreter'?  Is the core Python library compiled 
using different compilers for these two?

Eric, are you able to reproduce this at all?  I don't have access to Windows at 
the moment.

--

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



[issue1669539] Change (fix!) os.path.isabs() semantics on Win32

2010-09-29 Thread Ulrich Eckhardt

Changes by Ulrich Eckhardt eckha...@satorlaser.com:


--
nosy: +eckhardt

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



[issue9982] Pointer problem in initializing array of arrays

2010-09-29 Thread Marvin Mundry

New submission from Marvin Mundry marvin@gmx.de:

 m1=[[0,0,0,0]]*4
 m1
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
 m1[0][0]+=1
 m1
[[1, 0, 0, 0], [1, 0, 0, 0], [1, 0, 0, 0], [1, 0, 0, 0]]

after initializing an array of arrays as done in the first line of the code 
snippet all elements in the array point to the same object in memory.

--
components: None
messages: 117581
nosy: mastermarv
priority: normal
severity: normal
status: open
title: Pointer problem in initializing array of arrays
versions: Python 2.6

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



[issue1669539] Change (fix!) os.path.isabs() semantics on Win32

2010-09-29 Thread Ulrich Eckhardt

Ulrich Eckhardt eckha...@satorlaser.com added the comment:

I just stumbled across the issue with isabs(). I'd also say that Mark Hammond 
already provided the typical use case for this, i.e. that you allow relative 
paths for convenience when storing them or putting them on the commandline, but 
for actual use you first convert them so that their meaning doesn't change 
under your feet, e.g. because they depend on volatile things like the current 
working directory or drive.

If you assume that is the intention or typical use case, then calling isabs() 
to determine if the path is stable doesn't work. Of course, the wording of the 
documentation then needs to change, too, as it explicitly says after chopping 
off a potential drive letter.

Concerning the behaviour of path.join() and support for \\server\share paths, 
I'm not sure, but I think that these are issues that can be discussed/changed 
separately.

--

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



[issue5117] os.path.relpath problem with root directory

2010-09-29 Thread Ulrich Eckhardt

Changes by Ulrich Eckhardt eckha...@satorlaser.com:


--
nosy: +eckhardt

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



[issue9980] str(float) failure

2010-09-29 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

From their web page, it looks like PyScripter only runs on Windows, so I 
assume these results are generated there.

I won't be able to test on Windows until tonight.

Kiriakos: Does this only happen within PyScripter, or does it also happen when 
you use the python.exe using the same pythonxx.dll?

--

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



[issue9980] str(float) failure

2010-09-29 Thread Kiriakos Vlahos

Kiriakos Vlahos pyscrip...@gmail.com added the comment:

PyScripter is a Windows only IDE.  I am using the official release 
*** Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] 
on win32. ***

Python 3.2a2 fixes this since, according to SVN, str is now using the same code 
(or at least the same parameters to the _Py_dg_dtoa call) as repr.

I am afraid I do not have a minimal code to reproduce this, since the error 
only occurs with the python.dll embedded to PyScripter.  To reproduce with 
PyScripter you need to

a) Download and install the latest version of PyScripter from 
pyscripter.googlecode.com
b) Set the python engine to the internal (embedded python) using the menu (Run, 
Python Engine, Internal)
c) Execute in the interpreter window str(38210.0) etc.

The puzzling thing is that the same Python.dll when used by python.exe and not 
PyScripter produces correct results.  PyScripter does not mess up with 
built-ins in any way or set any special flags and I see no reason why results 
would differ.

--

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



[issue9980] str(float) failure

2010-09-29 Thread Kiriakos Vlahos

Kiriakos Vlahos pyscrip...@gmail.com added the comment:

Answer to Mark's question:

*** Python 3.2a2 (r32a2:84522, Sep  5 2010, 22:35:34) [MSC v.1500 32 bit 
(Intel)] on win32. ***
 '%.12g' % 38210.0
'3820:'

So indeed the error still exists in _Py_dg_dtoa.

The internal engine uses an embedded python.dll.  The remote engine uses a 
stand-alone pythonw.exe in a separate process and communicates with it with 
rpyc (http://rpyc.wikidot.com/).

--

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



[issue9979] Create PyUnicode_AsWideCharString() function

2010-09-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 But shouldn't PyUnicode_AsWideCharString() merge surrogate pairs when it
 can? The implementation doesn't do this.

I don't want to do two different things at the same time. My plan is:
 - create PyUnicode_AsWideCharString()
 - use PyUnicode_AsWideCharString() everywhere
 - patch unicode_aswidechar() (used by PyUnicode_AsWideChar() and 
PyUnicode_AsWideCharString()) to convert surrogates when needed

So, you agree with the API (and the documentation)?

--

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



[issue9981] let make_buildinfo use a temporary directory on windows

2010-09-29 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

Ooops, here is the patch.

--
keywords: +patch
Added file: http://bugs.python.org/file19056/make_buildinfo.patch

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



[issue9873] Allow bytes in some APIs that use string literals internally

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 A possible duck-typing approach here would be to replace the
 instance(x, str) tests with hasattr(x, 'encode') checks instead.

Looks more ugly than useful to me. People wanting to emulate str had better 
subclass it anyway...

--
nosy: +pitrou

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



[issue9975] Incorrect use of flowinfo and scope_id in IPv6 sockaddr tuple

2010-09-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +loewis
stage:  - patch review
versions: +Python 3.1, Python 3.2

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



[issue9982] Pointer problem in initializing array of arrays

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

That's expected behaviour, syntactically. Multiplying a sequence doesn't 
deep-copy its elements.
If you want an array of distinct arrays, just write:

 m1 = [[0,0,0,0] for i in range(4)]
 m1[1][0] = 6
 m1
[[0, 0, 0, 0], [6, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]

--
nosy: +pitrou
resolution:  - invalid
status: open - closed

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



[issue9978] test_os failures on XP-4 buildbot

2010-09-29 Thread Hirokazu Yamamoto

Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:

I cannot reproduce this in my environment...

E:\python-dev\py3kpy3k -m test.regrtest test_os
[1/1] test_os
[33503 refs]
1 test OK.
[85140 refs]

--

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



[issue5131] pprint doesn't know how to print a defaultdict

2010-09-29 Thread Nick Craig-Wood

Nick Craig-Wood n...@craig-wood.com added the comment:

Raymond Hettinger (rhettinger) wrote:
 Ben, I don't think there is any value is opening more issues like 
 pprint-doesn't-handle-object-x (named tuples, defautdicts, deques, 
 generators, etc).
 
 As it is currently designed, pprint doesn't offer usable hooks and it is not 
 easy to build-out to handle new object types.  For the most part, users just 
 cast to a list before calling pprint.

I mildly disagree, IMHO pprint should be able to make a decent job of all the 
built in types otherwise it loses its value as a debugging tool.  It is a 
suprise when a built in type doesn't pprint properly.

This would surely be an excellent use of the abstract base classes defined in 
the collections module for pprint to make a best guess as to how to print types 
it doesn't understand directly?

 ISTM, the RightAnswer(tm) is to overhaul pprint and add hooks for handling 
 new objects.  Ideally, there would be flexible print options and reprlib-like 
 features for limiting output and for marking recursive constructs with ...

That is a very good idea, but might be unecessary with the ABC idea above

--

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



[issue9979] Create PyUnicode_AsWideCharString() function

2010-09-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I fixed in this issue in multiple commits:
 - r85093: create PyUnicode_AsWideCharString()
 - r85094: use it in import.c
 - r85095: use it for _locale.strcoll()
 - r85096: use it for time.strftime()
 - r85097: use it in _ctypes module

 So, you agree with the API (and the documentation)?

Well, you can now directly patch the documentation. I think that the API is 
simple and fine :-)

--
resolution:  - fixed
status: open - closed

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



[issue9630] Reencode filenames when setting the filesystem encoding

2010-09-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Forget my previous message, I forgot important points.

 So the only reason why you have to go through
 all those hoops is to

 * allow the complete set of Python supported encoding
   names for the PYTHONFSENCODING

 * make sure that the Py_FilesystemDefaultEncoding is set
   to the actual name of the codec as used by the system

Not only. As I wrote in my first message (msg114191), there are two
other good reasons to keep the current code but redecode filenames:

 * Encoding aliases: locale encoding is not always written as the
   official Python encoding name. Eg. utf8 vs UTF-8, iso8859-1 vs
   latin_1, etc. We have to be able to load Lib/encodings/aliases.py to
   to get the Python codec.

 * Codecs implemented in Python: only ascii, latin1, utf8 and mbcs
   codecs are builtin. All other encodings are implemented in Python. If
   your filesystem encoding is ShiftJIS, you have to load
   Lib/encodings/shift_jis.py to load the codec.

For these two reasons, we have to import Python modules before being
able to set the filesystem encoding. So we have to redecode filenames
after setting the filesystem encodings.

 the redecoding of the filenames is fragile

We can setup a buildbot installed in a non-ascii path. Antoine had such
buildbot, which already helped to find many bugs related to non-ascii paths.

--

We can choose to only support ascii, latin1, utf8 and mbcs for the
filesystem encoding, but users will complain that we break compatibility
with old systems. Python3 already breaks the language, I don't think
that it is a good idea to choose to become incompatible with old systems
just to simplify (too much) the code.

--

Another solution would be to unload all modules, clear all caches,
delete all code objects, etc. after setting the filesystem encoding. But
I think that it is inefficient and nobody wants a slower Python startup.

--

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



[issue9962] GzipFile doesn't have peek()

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Committed in r85100.

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

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



[issue9630] Redecode filenames when setting the filesystem encoding

2010-09-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Patch version 4:
 - Rename reencode to redecode
 - Return -1 (instead of 1) on error

--
title: Reencode filenames when setting the filesystem encoding - Redecode 
filenames when setting the filesystem encoding
Added file: http://bugs.python.org/file19057/redecode_modules_path-4.patch

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



[issue9630] Redecode filenames when setting the filesystem encoding

2010-09-29 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Removed file: http://bugs.python.org/file18996/reencode_modules_path-3.patch

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



[issue9090] Error code 10035 calling socket.recv() on a socket with a timeout (WSAEWOULDBLOCK - A non-blocking socket operation could not be completed immediately)

2010-09-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
status: pending - closed

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread david

New submission from david db.pub.m...@gmail.com:

please add a large NOTE explaining that urllib does not perform any ssl 
validation.

--
assignee: d...@python
components: Documentation
messages: 117596
nosy: db, d...@python
priority: normal
severity: normal
status: open
title: please add a large NOTE explaining that urllib does not perform any ssl 
validation
versions: Python 2.7

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

-- (out of the box)

--

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Sounds reasonable to me.
(although I would like that to change, see issue1589)

--
nosy: +pitrou

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +orsenthil
versions: +Python 3.1, Python 3.2

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

This is issue is in respect to https connections :)

--

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

Hi pitrou, that bug you linked to is really long can state a summary of any 
changes made to python and their impact - alternatively the lack of (changes) 
and their impact.

--

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



[issue9984] please add a large NOTE explaining that urllib2 does not perform any ssl validation

2010-09-29 Thread david

New submission from david db.pub.m...@gmail.com:

please add a large NOTE explaining that urllib2 does not perform any ssl (for 
https connection) validation out of the box. 
Also see 9983 for urrlib.

--
messages: 117601
nosy: db
priority: normal
severity: normal
status: open
title: please add a large NOTE explaining that urllib2 does not perform any ssl 
validation

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



[issue9984] please add a large NOTE explaining that urllib2 does not perform any ssl validation

2010-09-29 Thread david

Changes by david db.pub.m...@gmail.com:


--
assignee:  - d...@python
components: +Documentation
nosy: +d...@python
versions: +Python 2.7

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Hi pitrou, that bug you linked to is really long can state a summary
 of any changes made to python and their impact - alternatively the
 lack of (changes) and their impact.

No changes yet unfortunately. As for the impact, you already know it,
since you filed this very issue :/

--

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I've added warnings for httplib, urllib, urllib2 in r85101, r85102 and r85103. 
The changes can take a day or two to appear online.

--
resolution:  - fixed
status: open - closed

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



[issue9984] please add a large NOTE explaining that urllib2 does not perform any ssl validation

2010-09-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
resolution:  - duplicate
status: open - closed
superseder:  - please add a large NOTE explaining that urllib does not perform 
any ssl validation

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

thank you :)

--
resolution: fixed - 
status: closed - open

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Senthil Kumaran

Changes by Senthil Kumaran orsent...@gmail.com:


--
Removed message: http://bugs.python.org/msg58435

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue9630] Reencode filenames when setting the filesystem encoding

2010-09-29 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

STINNER Victor wrote:
 
 STINNER Victor victor.stin...@haypocalc.com added the comment:
 
 Forget my previous message, I forgot important points.
 
 So the only reason why you have to go through
 all those hoops is to

 * allow the complete set of Python supported encoding
   names for the PYTHONFSENCODING

 * make sure that the Py_FilesystemDefaultEncoding is set
   to the actual name of the codec as used by the system
 
 Not only. As I wrote in my first message (msg114191), there are two
 other good reasons to keep the current code but redecode filenames:
 
  * Encoding aliases: locale encoding is not always written as the
official Python encoding name. Eg. utf8 vs UTF-8, iso8859-1 vs
latin_1, etc. We have to be able to load Lib/encodings/aliases.py to
to get the Python codec.
 
  * Codecs implemented in Python: only ascii, latin1, utf8 and mbcs
codecs are builtin. All other encodings are implemented in Python. If
your filesystem encoding is ShiftJIS, you have to load
Lib/encodings/shift_jis.py to load the codec.
 
 For these two reasons, we have to import Python modules before being
 able to set the filesystem encoding. So we have to redecode filenames
 after setting the filesystem encodings.

No, that's not needed ! Please see my earlier message: you can still
do all this at a later time during startup and double-check that
the encoding is indeed valid.

The main point is that you don't need to apply all those checks
before setting the file system encoding in the interpreter.
Early on you just assume that the env vars are setup correctly
and head on into starting up the interpreter.

If the decoding fails during startup due to a wrong encoding of
file or path names, the interpreter will signal this. If you have
a case where everything imports fine, you can then still double
check at the time the file system encoding is set now to e.g.
detect cases where the encoding was set to ascii, but in reality
the interpreter was just lucky and the file system encoding
should be utf-8.

--
title: Redecode filenames when setting the filesystem encoding - Reencode 
filenames when setting the filesystem encoding

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Senthil Kumaran

Senthil Kumaran orsent...@gmail.com added the comment:

Removed this message by mistake.

Author  ahasenack
Date2007-12-11.21:11:53

Ups, typo in the script:
cert = verisign-inc-class-3-public-primary.pem

--
nosy: +orsenthil

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



[issue9630] Reencode filenames when setting the filesystem encoding

2010-09-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Le mercredi 29 septembre 2010 13:45:15, vous avez écrit :
 Marc-Andre Lemburg m...@egenix.com added the comment:
 
 STINNER Victor wrote:
  STINNER Victor victor.stin...@haypocalc.com added the comment:
  
  Forget my previous message, I forgot important points.
  
  So the only reason why you have to go through
  all those hoops is to
  
  * allow the complete set of Python supported encoding
  
names for the PYTHONFSENCODING
  
  * make sure that the Py_FilesystemDefaultEncoding is set
  
to the actual name of the codec as used by the system
  
  Not only. As I wrote in my first message (msg114191), there are two
  
  other good reasons to keep the current code but redecode filenames:
   * Encoding aliases: locale encoding is not always written as the
   
 official Python encoding name. Eg. utf8 vs UTF-8, iso8859-1 vs
 latin_1, etc. We have to be able to load Lib/encodings/aliases.py to
 to get the Python codec.
   
   * Codecs implemented in Python: only ascii, latin1, utf8 and mbcs
   
 codecs are builtin. All other encodings are implemented in Python. If
 your filesystem encoding is ShiftJIS, you have to load
 Lib/encodings/shift_jis.py to load the codec.
  
  For these two reasons, we have to import Python modules before being
  able to set the filesystem encoding. So we have to redecode filenames
  after setting the filesystem encodings.
 
 No, that's not needed ! Please see my earlier message: you can still
 do all this at a later time during startup and double-check that
 the encoding is indeed valid.

I don't understand how. Eg. if you set Py_FileSystemDefaultEncoding to 
cp1252 before loading the first module, import a module will have to load the 
codec. Load the codec require to import a module. But how can you open cp1252 
module since you are unable to encode paths to the filesystem encoding (because 
the cp1252 codec is not available yet)?

 If the decoding fails during startup due to a wrong encoding of
 file or path names, ...

It is not not problem described in my previous message. How do you load non-
builtin codecs?

Can you write a patch implementing your ideas? I tried to write such patch 
(set Py_FileSystemDefaultEncoding before loading the first module), but it 
doesn't work for different reasons (all described in this issue). Maybe I 
misunderstood your proposition.

--

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

@pitrou you should also put an example of how to ACTUALLY establish a 
connection that can't be MITMed. Because lots of people are getting this 
wrong

--

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 @pitrou you should also put an example of how to ACTUALLY establish a
 connection that can't be MITMed. Because lots of people are getting
 this wrong

It would require writing the code for checking hostnames that the ssl
module currently lacks, so if I write that code I'd rather add it to the
ssl module rather than as an example in the docs :)

But, yes, I agree that the situation is quite unsatisfying right now.

--

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



[issue6640] urlparse should parse mailto: URL headers as query parameters

2010-09-29 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Which would be a bug.  According to RFC3986 it should be the path.  So the 
change can't be quite so simple as adding mailto to uses_query.  Since the 
query component is defined for generic uris according to the RFC, it sounds 
like urllib's parser needs some enhancement.

--
nosy: +r.david.murray
type: behavior - feature request
versions:  -Python 2.7, Python 3.1

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

Yes totally imho these modules should get fixed to actually do ssl checking.
This means that most users of these methods, even if they think they
are doing it properly as per the ssl module page, are still vulnerable
to attack.

I will add this comment to the bug you linked to above.
As an example, it only took a few minutes to confirm that the default
bzr install on ubuntu is vulnerable -
https://bugs.edge.launchpad.net/bzr/+bug/651161
(bzr is only vulnerable if pycurl isn't installed but pycurl is only a
suggestion not a dependency ... ).

--

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



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

2010-09-29 Thread Marien Zwart

New submission from Marien Zwart m_zw...@123mail.org:

SequenceMatcher caches the result of get_matching_blocks and get_opcodes. There 
are some problems with this:

What get_matching_blocks caches is a list of tuples. The first call does not 
return that list: it returns map(Match._make, self.matching_blocks) (converting 
the tuples to namedtuples). Subsequent calls just return self.matching_blocks 
directly. Especially in python 3 and up this is weird, since the first call 
returns a map object while later calls return a list.

This caching behavior is not documented, so calling code may mutate the 
returned list. One example of calling code is difflib itself: 
get_grouped_opcodes mutates the result of get_opcodes (a cached list). I am not 
sure if the right fix is to have get_grouped_opcodes copy before it mutates or 
to have get_opcodes return a copy.

Snippet demonstrating both bugs:

matcher = difflib.SequenceMatcher(a='bc', b='dc')
print(list(matcher.get_matching_blocks()))
# This should print the same thing, but it does not:
print(list(matcher.get_matching_blocks()))

print(matcher.get_opcodes())
print(list(matcher.get_grouped_opcodes()))
# This should print the same thing as the previous get_opcodes()
# list, but it does not:
print(matcher.get_opcodes())

--
components: Library (Lib)
messages: 117612
nosy: marienz
priority: normal
severity: normal
status: open
title: difflib.SequenceMatcher has slightly buggy and undocumented caching 
behavior
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

Welcome to 2010.
SSL shouldn't be difficult to use anymore or support in python applications. 
But yet, until the changes in http://bugs.python.org/issue9983 was fixed python 
devs were using modules without any warning of the security implications. 
pycurl works ... but a *LOT* of coders are not using pycurl. 

Today they are still getting it wrong and are still vulnerable to mitm attacks 
against https on the client side.

I have an example in fairly large open source project:
bzr -- (by default due to a dependency failure ... on not depending on 
pycurl).  
https://bugs.edge.launchpad.net/ubuntu/+source/checkbox/+bug/625076


Less large:
libcloud http://github.com/apache/libcloud/issues/issue/2
linode-python http://github.com/tjfontaine/linode-python/issues/issue/1

I would *very* much like to see these methods fixed by default.
You can talk about how the ssl protocol is not secure because of ca's handling 
certificates poorly, but until you *actually* perform proper validation you 
cannot say these things imho. 

I can keep on looking at python projects and reporting these issues but it is 
really easy, just look at anything that says and is important that mitm isn't 
possible against it - then check the deps. in ubuntu /debian and pick the ones 
that don't use pycurl, check they don't validate the common name etc. and then 
you have a bunch of mitm'able apps probably ;)

--
nosy: +db

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



[issue9986] PDF files of python docs have text missing

2010-09-29 Thread Amber Jain

New submission from Amber Jain i.amber.j...@gmail.com:

CC: d...@python.org

I was planning to print the official python 2.7 tutorial: 
http://docs.python.org/tutorial/index.html.
So, I went over to Download page: http://docs.python.org/download.html and 
downloaded the PDF file. But the PDF have some missing text due to width of 
page being less than number of chars to put on a line.
For example, please have a look at page-21 (Section 3.1.3 titled Unicode 
Strings). It has an incomplete line from HTML documentation.
Here's a screenshot of what I see (and mean):
http://amberj.devio.us/pub/screenshots/pdfdoc.png

There's a line somewhere in the middle of screenshot which goes out of boundary 
of PDF document and fails to put out-of-boundary text on newline.
From what I had read, it seems that this happens only with 'code snippets' in 
tutorial. This is probably a problem with convertor (HTML to PDF?).

Can you guys please fix it?
Thanks a lot.

--
components: None
messages: 117614
nosy: amberj
priority: normal
severity: normal
status: open
title: PDF files of python docs have text missing
versions: Python 2.7

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



[issue9978] test_os failures on XP-4 buildbot

2010-09-29 Thread Hirokazu Yamamoto

Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:

I created the patch to fix this issue. WINFUNCTYPE is not member
of ctypes.wintypes, but ctypes.

--
keywords: +patch
Added file: http://bugs.python.org/file19058/py3k_fix_test_os.patch

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



[issue9978] test_os failures on XP-4 buildbot

2010-09-29 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

I just checked in the importing changes to r85109 and r85110 (I saw your branch 
checkins happening at the same time, sorry).

--

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



[issue9978] test_os failures on XP-4 buildbot

2010-09-29 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Do you think we need the other parts of that patch? It seems like the only real 
issue here was the importing.

--
resolution:  - fixed
stage: needs patch - commit review

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



[issue9360] nntplib cleanup

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I've committed the latest patch in r85111.

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

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



[issue9986] PDF files of python docs have text missing

2010-09-29 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
assignee:  - d...@python
components: +Documentation -None
nosy: +d...@python
type:  - behavior

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



[issue9980] str(float) failure

2010-09-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 The puzzling thing is that the same Python.dll when used by python.exe and 
 not PyScripter produces correct results.

Yes, this is indeed puzzling.  Are you absolutely sure that both python.exe and 
PyScripter are using the exact same Python.dll file?  E.g., can you check that 
renaming/deleting/moving the Python.dll file to somewhere else causes both 
python.exe and PyScripter to fail to execute?

I really can't think of anything in the environment which might affect whether 
this bug occurs or not.

It's difficult to proceed here without a concrete way to reproduce the error.  
I can (and will) add the particular bad values you found as new testcases, so 
that if the error is present on any of the buildbots it'll show up.

--

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



[issue9980] str(float) failure

2010-09-29 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
versions: +Python 3.2

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



[issue9963] test_sysconfig when LDFLAGS defined in the user's environment

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Looks like a duplicate of #9437, and there's a patch you can review there :)

--
nosy: +pitrou
resolution:  - duplicate
status: open - closed
superseder:  - can't build extensions with non-default ldflags (e.g. -m32)

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



[issue9980] str(float) failure

2010-09-29 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

It's interesting to note that '9' is ascii 57, and ':' is 58. It's like the 
code is incrementing the wrong digit. If it's related to that, that indeed 
sounds like a compiler optimization bug to me, but of course I'm just guessing. 
And I'm not sure that conclusion matches the rest of the known facts.

--

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



[issue9980] str(float) failure

2010-09-29 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

I get different results than Kiriakos' last example.


PCbuild\amd64\python_d.exe
Python 3.2a2+ (py3k, Sep 29 2010, 09:43:42) [MSC v.1500 64 bit (AMD64)] on win32

Type help, copyright, credits or license for more information.
 '%.12g' % 38210.0
'38210'

--
nosy: +brian.curtin

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



[issue9980] str(float) failure

2010-09-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 It's interesting to note that '9' is ascii 57, and ':' is 58.

Right;  it's that part that convinces me that the problem is somewhere deep in 
_Py_dg_dtoa, in the guts of the float to string conversion, where a 
xxx99... result is rounded up to xx(x+1)00... incorrectly.  And it 
seems at least possible that there's a compiler bug somewhere, since it's 
happened before.  It's also possible that there's a bug in _Py_dg_dtoa;  this 
seems fairly unlikely (but certainly not out of the question), since this bit 
is pretty much exactly David Gay's original code.

--

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



[issue9978] test_os failures on XP-4 buildbot

2010-09-29 Thread Hirokazu Yamamoto

Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:

Other parts are needed for my environment. If machine
is really slow, there is possibility of subprocess
being killed before execution reaches wintypes.WINFUNCTYPE
line.

--

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



[issue9621] Graphviz output for 2to3 fixer patterns

2010-09-29 Thread Matt Bond

Matt Bond gmattb...@gmail.com added the comment:

Huh. I must have diffed the wrong version of my code - how embarrassing!

I'll update the attached patch later this week. Thanks for catching that.

--

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



[issue5672] Implement a way to change the python process name

2010-09-29 Thread Ludvig Ericson

Ludvig Ericson lud...@lericson.se added the comment:

I use the setproctitle module extensively. It has worked flawlessly.

What would be needed for this to get accepted? I realize one shouldn't stress 
such a decision, but still I feel this is something the standard library should 
be able to do.

My justification for inclusion into the standard library is that one has to 
make a workaround on systems where setproctitle ISN'T installed (I don't feel 
such a small component should be a requirement for production use.)

Everywhere I use setproctitle, I have to go:

try:
from setproctitle import setproctitle
except ImportError:
setproctitle = lambda t: None

Which is not only rather lengthy, but also IMO entirely unnecessary. As I 
noted, setting the process title is mostly for convenience and aesthetics, and 
therefore it's hard to justify the dependency. For that reason I think standard 
library inclusion is more relevant than otherwise.

So, are there any other reasons to wait with this other than the need of a PEP 
and proposing that to python-dev or whatever forum is best suited?

--
nosy: +lericson

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



[issue5672] Implement a way to change the python process name

2010-09-29 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

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



[issue9987] usenetrc option broken

2010-09-29 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

The nntplib cleanup broke the usenetrc option to NNTP:


Traceback (most recent call last):
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_nntplib.py, line 
167, in setUp
self.server = NNTP(self.NNTP_HOST, timeout=TIMEOUT)
  File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/nntplib.py, line 
937, in __init__
readermode, usenetrc, timeout)
  File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/nntplib.py, line 
329, in __init__
auth = credentials.authenticators(host)
NameError: global name 'host' is not defined

--
assignee: pitrou
components: Library (Lib)
messages: 117627
nosy: pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: usenetrc option broken
type: behavior
versions: Python 3.2

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



[issue9987] usenetrc option broken

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Fixed in r85114.

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

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



[issue9437] can't build extensions with non-default ldflags (e.g. -m32)

2010-09-29 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy: +brett.cannon

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



[issue9630] Reencode filenames when setting the filesystem encoding

2010-09-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I commited redecode_modules_path-4.patch as r85115 in Python 3.2.

--
resolution:  - fixed
status: open - closed

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-09-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

r85115 closes #9630: an important patch for #9425, redecode all filenames when 
setting the filesystem encoding.

Next tasks (maybe not in this order):
 - merge getpath.c
 - redecode argv[0] used by PySys_SetArgvEx() to feed sys.path (encode argv[0] 
with the locale encoding and then decode it using the filesystem encoding): it 
is required if PYTHONFSENCODING environment variable is used
 - merge import.c (in small patchs if it's possible)
 - and other things that I forgot

--

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



[issue9988] test_warnings fails with PYTHONFSENCODING=latin-1 on UNIX/BSD

2010-09-29 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

$ PYTHONFSENCODING=latin-1 ./python Lib/test/test_warnings.py 
...
==
FAIL: test_nonascii (__main__.CEnvironmentVariableTests)
--
Traceback (most recent call last):
  File Lib/test/test_warnings.py, line 731, in test_nonascii
['ignore:DeprecaciónWarning'].encode('utf-8'))
AssertionError: b['ignore:Deprecaci\\udcf3nWarning'] != 
b['ignore:Deprecaci\xc3\xb3nWarning']

==
FAIL: test_nonascii (__main__.PyEnvironmentVariableTests)
--
Traceback (most recent call last):
  File Lib/test/test_warnings.py, line 731, in test_nonascii
['ignore:DeprecaciónWarning'].encode('utf-8'))
AssertionError: b['ignore:Deprecaci\\udcf3nWarning'] != 
b['ignore:Deprecaci\xc3\xb3nWarning']

--

The problem is that subprocess encodes PYTHONWARNINGS environment variable 
value with the filesystem encoding, whereas Py_main() decodes the variable 
value with the locale encoding.

History of how the variable is read in py3k:
 - #7301: r79880 creates this variable, use mbstowcs() and PySys_AddWarnOption()
 - #7301: r80066 uses setlocale(LC_ALL, ), and replaces mbstowcs() by 
_Py_char2wchar() (to support surrogates)
 - #8589: r81358 creates PySys_AddWarnOptionUnicode() and replaces 
_Py_char2wchar() by PyUnicode_DecodeFSDefault()
 - #8589: r84694 replaces PyUnicode_DecodeFSDefault() by _Py_char2wchar() + 
PyUnicode_FromWideChar() because the PyCodec machinery is not ready yet
 - #8589: r84731 uses PyUnicode_FromString() (utf-8) on Mac OS X

--
components: Tests, Unicode
messages: 117631
nosy: haypo
priority: normal
severity: normal
status: open
title: test_warnings fails with PYTHONFSENCODING=latin-1 on UNIX/BSD
versions: Python 3.2

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



[issue5131] pprint doesn't know how to print a defaultdict

2010-09-29 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

IMHO pprint should be able to make a decent job of all the built in types 

Agreed, already true as far as I know, and irrelevant. This issue is not about 
built-in types in the builtins module, as documented Lib Ref chapter 5 
*Built-in Types*. Collections is an Python-coded stdlib  module that happens to 
import a couple of its classes from _collections, written in C for speed. 

I agree with Raymond that pprint needs a generic solution better than 
special-casing one class after another. Your idea of using ABCs intriguing.

--

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



[issue9647] os.confstr() does not handle value changing length between calls

2010-09-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

If I understood correctly, you don't want the value to be truncated if the 
variable grows between the two calls to confstr(). Which behaviour would you 
expect? A Python exception?

 but Victor Stinner has expressed concern that a buggy
 confstr() could create a near-infinite loop with that patch
 applied

Yes, I think that two calls to confstr() should be enough.

--
nosy: +haypo

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



[issue9630] Reencode filenames when setting the filesystem encoding

2010-09-29 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

STINNER Victor wrote:
 
 STINNER Victor victor.stin...@haypocalc.com added the comment:
 
 Le mercredi 29 septembre 2010 13:45:15, vous avez écrit :
 Marc-Andre Lemburg m...@egenix.com added the comment:

 STINNER Victor wrote:
 STINNER Victor victor.stin...@haypocalc.com added the comment:

 Forget my previous message, I forgot important points.

 So the only reason why you have to go through
 all those hoops is to

 * allow the complete set of Python supported encoding

   names for the PYTHONFSENCODING

 * make sure that the Py_FilesystemDefaultEncoding is set

   to the actual name of the codec as used by the system

 Not only. As I wrote in my first message (msg114191), there are two

 other good reasons to keep the current code but redecode filenames:
  * Encoding aliases: locale encoding is not always written as the
  
official Python encoding name. Eg. utf8 vs UTF-8, iso8859-1 vs
latin_1, etc. We have to be able to load Lib/encodings/aliases.py to
to get the Python codec.
  
  * Codecs implemented in Python: only ascii, latin1, utf8 and mbcs
  
codecs are builtin. All other encodings are implemented in Python. If
your filesystem encoding is ShiftJIS, you have to load
Lib/encodings/shift_jis.py to load the codec.

 For these two reasons, we have to import Python modules before being
 able to set the filesystem encoding. So we have to redecode filenames
 after setting the filesystem encodings.

 No, that's not needed ! Please see my earlier message: you can still
 do all this at a later time during startup and double-check that
 the encoding is indeed valid.
 
 I don't understand how. Eg. if you set Py_FileSystemDefaultEncoding to 
 cp1252 before loading the first module, import a module will have to load 
 the 
 codec. Load the codec require to import a module. But how can you open cp1252 
 module since you are unable to encode paths to the filesystem encoding 
 (because 
 the cp1252 codec is not available yet)?

Ah, sorry, I forgot about that important circular reference :-)

You're right: there's no way to guarantee that file and path
decoding will work without first setting the file system encoding
to one of the builin codec names (latin-1 would be a good choice).

The other option would be to import everything using relative
paths (since Python itself only uses ASCII path names to the modules),
until the codec is loaded and then add the absolute paths to
these relative ones, once the codec has been loaded successfully.

A third option is the one you mentioned earlier on: we simply
don't allow Python to be installed on paths that are not
decodable using one of the builtin codecs.

 If the decoding fails during startup due to a wrong encoding of
 file or path names, ...
 
 It is not not problem described in my previous message. How do you load non-
 builtin codecs?
 
 Can you write a patch implementing your ideas? I tried to write such patch 
 (set Py_FileSystemDefaultEncoding before loading the first module), but it 
 doesn't work for different reasons (all described in this issue). Maybe I 
 misunderstood your proposition.

No, I wasn't thinking of the situation where you want to use a
codec that requires a Python module.

--

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



[issue9971] Optimize BufferedReader.readinto

2010-09-29 Thread Daniel Urban

Changes by Daniel Urban urban.dani...@gmail.com:


--
nosy: +durban

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Zooko O'Whielacronx

Zooko O'Whielacronx zo...@zooko.com added the comment:

This appears to be a concern for some people. Maybe the builtin ssl module 
should be deprecated if there isn't a lot of manpower to maintain it and 
instead the well-maintained pyOpenSSL package should become the recommended 
tool?

Here is a letter that I just received, in my role as a developer of Tahoe-LAFS, 
from a concerned coder who doesn't know much about Python:

 An FYI on Python.
 
 I'm not sure how businesses handle this (I've always worked in Windows
 shops), but I imagine some might consider pulling Python until it is
 properly secured. Pulling Python might affect Tahoe, which I would
 like to see do well.

Here is my reply to him:

 Thanks for the note warning me about this issue! I appreciate it.
 
 The Tahoe-LAFS project doesn't use the builtin ssl module that comes
 with the Python Standard Library and instead uses the separate
 pyOpenSSL package (and uses the separate Twisted package for HTTP and
 other networking protocols). Therefore this isn't an issue for
 Tahoe-LAFS. I agree that it is potentially a marketing issue in that
 people might mistakenly think that Tahoe-LAFS is vulnerable or might,
 as you suggest, blacklist Python as such and thus hit Tahoe-LAFS as
 collateral damage. There's not much I can do about that from the
 perspective of a Tahoe-LAFS developer. From the perspective of 
 contributor to Python, I'm also not sure what to do, except perhaps to
 complain. :-) I guess I'll try to stir the waters a bit by suggesting
 that Python should deprecate the builtin ssl module and recommend
 the pyOpenSSL package instead.

--
nosy: +zooko

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Ryan Tucker

Changes by Ryan Tucker rtuc...@gmail.com:


--
nosy: +Ryan.Tucker

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Here is a letter that I just received, in my role as a developer of
 Tahoe-LAFS, from a concerned coder who doesn't know much about Python:
 
  An FYI on Python.
  
  I'm not sure how businesses handle this (I've always worked in
 Windows
  shops), but I imagine some might consider pulling Python until it is
  properly secured. Pulling Python might affect Tahoe, which I would
  like to see do well.

That sounds like an inventively outrageous kind of FUD. It's the first
time I hear of someone writing to third-party library authors in order
to pressure them to pressure the maintainers of a programming language
implementation to make some decisions.

By the way, if businesses are really concerned about the security
problems induced by this issue, they can sponsor the effort to get the
bug fixed. It shouldn't be a lot of work.

 This appears to be a concern for some people. Maybe the builtin ssl
 module should be deprecated if there isn't a lot of manpower to
 maintain it and instead the well-maintained pyOpenSSL package should
 become the recommended tool?

Correct me if I'm wrong, but the well-maintained pyOpenSSL package
doesn't have the missing functionality (hostname checking in server
certificates), either. M2Crypto has it, though.

--

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



[issue9989] ctypes bitfield problem

2010-09-29 Thread Daniel Stutzbach

New submission from Daniel Stutzbach dan...@stutzbachenterprises.com:

The following program should print 0xdead but instead prints 0x0.  This 
came from the following stackoverflow question:
http://stackoverflow.com/questions/3824617/python-structure-always-stuck-at-0-no-matter-what-value-you-assign-to-it

import ctypes
class Blah(ctypes.Structure):
_fields_ = [(a, ctypes.c_uint64, 64),
(b, ctypes.c_uint16, 16),
(c, ctypes.c_uint8, 8),
(d, ctypes.c_uint8, 8)]

x = Blah(0xDEAD,0xBEEF,0x44,0x12)
print(hex(x.a))

--
components: Library (Lib)
messages: 117637
nosy: stutzbach, theller
priority: normal
severity: normal
stage: unit test needed
status: open
title: ctypes bitfield problem
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

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



[issue9980] str(float) failure

2010-09-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Added the extra test cases (for py3k only) in r85119.

--

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Devin Cook

Devin Cook devin.c.c...@gmail.com added the comment:

 Correct me if I'm wrong, but the well-maintained pyOpenSSL
 package doesn't have the missing functionality (hostname
 checking in server certificates), either.

I'm pretty sure it's just a wrapper around the openssl library, which does not 
include it. That was Bill Janssen's argument for why the ssl module shouldn't 
do that verification. Well, that and the fact that there's no finalized 
standard for it yet. I believe this is the latest draft:
http://tools.ietf.org/html/draft-saintandre-tls-server-id-check-09

--

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread geremy condra

geremy condra debat...@gmail.com added the comment:

On Wed, Sep 29, 2010 at 11:34 AM, Antoine Pitrou rep...@bugs.python.org wrote:

 Antoine Pitrou pit...@free.fr added the comment:

 Here is a letter that I just received, in my role as a developer of
 Tahoe-LAFS, from a concerned coder who doesn't know much about Python:

  An FYI on Python.
 
  I'm not sure how businesses handle this (I've always worked in
 Windows
  shops), but I imagine some might consider pulling Python until it is
  properly secured. Pulling Python might affect Tahoe, which I would
  like to see do well.

 That sounds like an inventively outrageous kind of FUD. It's the first
 time I hear of someone writing to third-party library authors in order
 to pressure them to pressure the maintainers of a programming language
 implementation to make some decisions.

Not to add fuel to the fire, but I've had a user report this behavior
as a bug as well, so this isn't entirely outside the scope of
plausibility to me.

 By the way, if businesses are really concerned about the security
 problems induced by this issue, they can sponsor the effort to get the
 bug fixed. It shouldn't be a lot of work.

What would the approximate cost on that be, do you think? My
understanding was that the code was pretty much written given John
Nagle's patch and M2Crypto.

Geremy Condra

--

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

  Correct me if I'm wrong, but the well-maintained pyOpenSSL
  package doesn't have the missing functionality (hostname
  checking in server certificates), either.
 
 I'm pretty sure it's just a wrapper around the openssl library, which
 does not include it. That was Bill Janssen's argument for why the ssl
 module shouldn't do that verification. Well, that and the fact that
 there's no finalized standard for it yet. I believe this is the latest
 draft:
 http://tools.ietf.org/html/draft-saintandre-tls-server-id-check-09

Well, to be clear, it shouldn't be done *automatically*. But providing a
helper function that implements the feature and lets higher layers like
http.client and urllib.request call it if desired would be more than
reasonable.

(openssl may not provide such a function, but gnutls does, by the way)

--

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



[issue8879] Implement os.link on Windows

2010-09-29 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Now that I think of it, that behavior is expected. Hard links are *supposed* to 
be different directory entries, so they would come out of that function as-is, 
and the current tests are correctly implemented.

Uploaded to http://codereview.appspot.com/2290042

--
Added file: http://bugs.python.org/file19059/issue8879_v2.diff

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 What would the approximate cost on that be, do you think? My
 understanding was that the code was pretty much written given John
 Nagle's patch and M2Crypto.

To err on the safe side and account for integration work (unit tests,
coding style, and use in http.client / urllib), I would say a couple of
days. Also because it's rather boring code :-)

(but, don't assume that urllib will then be secure by default; Python
doesn't ship with CA certificates, so existing code will still need a
bit of work to activate cert validation and pass the location of the
system's CA certs)

--

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



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

2010-09-29 Thread Lenard Lindstrom

New submission from Lenard Lindstrom le...@telus.net:

If an exporter returns a Py_buffer with ndim 1, PyMemoryView_FromObject changes 
the shape and strides pointer fields to point to a local Py_buffer array field. 
This array field is undocumented. Any heap memory these pointers reference is 
lost. Should the exporter's bf_releasebuffer later try and free the memory, the 
Python interpreter may segfault.

Attached is a demonstration program. Its output is:

Accessing buffer directly...
Accessing buffer through a memory view...
* View-shape has changed.
Done.

where the third line shows bf_releasebuffer has detected a changed pointer.

--
components: Interpreter Core
files: bufrel.c.gz
messages: 117644
nosy: kermode
priority: normal
severity: normal
status: open
title: PyMemoryView_FromObject alters the Py_buffer after calling 
PyObject_GetBuffer when ndim 1
type: crash
versions: Python 3.2
Added file: http://bugs.python.org/file19060/bufrel.c.gz

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



[issue9959] int(math.log(4,2)) == 1 instead of 2

2010-09-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Applied further tweaks in r85120:  for an integer n, log(n) is now computed as 
log(float(n)), provided only that n is small enough to be converted to a float 
without overflow.  This puts log on a more equal footing with all the other 
math module functions, and satisfies the (reasonable, IMO) expectation that 
log(n) == log(float(n)) for small integers n.

As a nice side-effect, this change guarantees that on a machine where log10 has 
reasonable accuracy (e.g., accurate to within 0.9 ulps or so), log10(10**n)==n 
for any nonnegative integer n such that 10**n is within the range of a double.

--

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



[issue9980] str(float) failure

2010-09-29 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I can reproduce this using the internal (embedded python) of PyScripter
(nice work BTW!).

I can't reproduce it under any other circumstances. The test case
from #9215 runs fine in VS, and also this produces the correct output:


#include Python.h

int
main(int argc, char *argv[])
{
  Py_Initialize();
  PyRun_SimpleString(print str(38210.0));
  Py_Finalize();
  return 0;
}


I ran all tests with the x86 release of 2.7.

--
nosy: +skrah

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



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

2010-09-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
assignee:  - pitrou
nosy: +pitrou
stage:  - needs patch
versions: +Python 2.7, Python 3.1

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



[issue9988] test_warnings fails with PYTHONFSENCODING=latin-1 on UNIX/BSD

2010-09-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +brett.cannon

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

imho it would be nice to be 'secure by default' in say the next python stable 
releases... (or perhaps only 3.X ? ).

--

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



[issue9988] test_warnings fails with PYTHONFSENCODING=latin-1 on UNIX/BSD

2010-09-29 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

OK, so who's messing up: subprocess or Py_main()?

--

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



[issue9980] str(float) failure

2010-09-29 Thread Martin v . Löwis

Changes by Martin v. Löwis mar...@v.loewis.de:


--
nosy: +loewis

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



[issue9988] test_warnings fails with PYTHONFSENCODING=latin-1 on UNIX/BSD

2010-09-29 Thread Philip Jenvey

Changes by Philip Jenvey pjen...@underboss.org:


--
nosy: +pjenvey

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Please don't say that urllib does not perform any ssl validation. It 
certainly *does* perform ssl validation, namely it validates whether the 
payload received over ssl matches the certificate received from the server.

What it does not do is to validate the server certificate in any form (AFAIU).

--
nosy: +loewis

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread david

david db.pub.m...@gmail.com added the comment:

@loewis yes.. that is assumed imho.
This ticket is closed, is this a real issue?

--

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



[issue9983] please add a large NOTE explaining that urllib does not perform any ssl validation

2010-09-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 What it does not do is to validate the server certificate in any form (AFAIU).

The warning I have added says “When opening HTTPS (or FTPS) URLs, it is
not attempted to validate the server certificate.”
(see http://docs.python.org/library/urllib.html )

So I don't think we have a disagreement here.

--

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



[issue9969] tokenize: add support for tokenizing 'str' objects

2010-09-29 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

As per Antoine's comment on #9873, requiring a real string via 
isinstance(source, str) to trigger the string IO version is likely to be 
cleaner than attempting to duck-type this. Strings are an area where we make so 
many assumptions about the way their internals work that duck-typing generally 
isn't all that effective.

--

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



  1   2   3   >