[issue5639] Support TLS SNI extension in ssl module

2009-08-31 Thread Daniel Black

Daniel Black dan...@cacert.org added the comment:

The small deficiency with these patches is that the specified
server_hostname is almost always the hostname that is used in the socket
pair of connect. Is it appropriate to grab the hostname value and use it
in the SNI extension header?

--

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



[issue6788] codecs.open on Win32 does not force binary mode

2009-08-31 Thread Amaury Forgeot d'Arc

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

I think your test is invalid: it creates the file in w mode, so \n are 
written as two bytes \r\n on the disk.
codecs.open just reads them back.

--
nosy: +amaury.forgeotdarc
resolution:  - invalid
status: open - pending

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



[issue6809] Python string.lstrip bug?

2009-08-31 Thread Andrew Liu

New submission from Andrew Liu mushywu...@gmail.com:

A simple lstrip on the following causes an extra character to be
stripped, as per the below. Tried on 2.6.1 and on 2.4.3, as below.

Python 2.6.1 (r261:67515, Feb 27 2009, 02:54:13)
[GCC 4.3.2 20081105 (Red Hat 4.3.2-7)] on linux2
Type help, copyright, credits or license for more information.
 a = contact_work_phone_no
 a.lstrip(contact)
'_work_phone_no'
 a.lstrip(contact_)
'work_phone_no'
 a = contact_city
 a.lstrip(contact_)
'ity'
 a.lstrip(con)
'tact_city'
 a.lstrip(contact)
'_city'
 a.lstrip(contact_)
'ity'



Python 2.4.3 (#1, Mar 14 2007, 19:01:42)
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
Type help, copyright, credits or license for more information.
 a = contact_city
 a.lstrip(contact_)
'ity'


--
components: Build
messages: 92102
nosy: mushywushy
severity: normal
status: open
title: Python string.lstrip bug?
type: behavior
versions: Python 2.6

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



[issue6801] symmetric_difference_update documentation fix

2009-08-31 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

 Well, in that case I don't understand how it is different from
 difference_update() ?

It's different from difference_update because that takes multiple
arguments. The operator form shows an equivalent and therefore shows how
to write an equivalent of the method with multiple arguments.

 suggesting that you can pipe several sets with -=,
 exactly like what you can do with ^=.

Of course you can put multiple or'ed sets on the right of ^=, but then
you can put every expression there.

 In other words, this whole section is unclear in 
 what other is, and why we have others sometimes.
 (eg a set or a several sets piped together for example)

I've fixed two other descriptions in r74603, it should be consistent now.

--

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



[issue6809] Python string.lstrip bug?

2009-08-31 Thread Mark Dickinson

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

This is not a bug:  the argument to lstrip effectively specifies a set 
of characters to be removed;  in your example, 'c' is in that set, so 
the 'c' at the beginning of city gets removed.  'i' is not in that set, 
so it stays. 

lstrip(...)
S.lstrip([chars]) - string or unicode

Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.

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

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



[issue2973] _ssl compiler warnings

2009-08-31 Thread Daniel Black

Daniel Black dan...@cacert.org added the comment:

The changeset that changed the definitions is here:
http://cvs.openssl.org/chngview?cn=12024 (2004-Mar-14 23:15:13 (UTC))

As you can see there is no easy identifier in the changeset (i'm not
sure how portable an ifdef on a typedef is (possible
asn1_const_ctx_st/ASN1_const_CTX)).

The patch i've done goes of then next OPENSSL_VERSION_NUMBER change
which occurred here
http://cvs.openssl.org/filediff?f=openssl/crypto/opensslv.hv1=1.36.2.35v2=1.36.2.36
(2004/03/17 11:40:44) ~3 days later.

Same patch applies to p3k

--
keywords: +patch
nosy: +grooverdan
versions: +Python 2.7, Python 3.0, Python 3.1, Python 3.2
Added file: 
http://bugs.python.org/file14811/issue2973-D2I_PARAMETER_2_TYPE.patch

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



[issue6810] add link to the documentation of signal.signal

2009-08-31 Thread Yinon Ehrlich

New submission from Yinon Ehrlich yino...@users.sourceforge.net:

in http://docs.python.org/library/signal.html#signal.signal the reader
is referred to see the reference manual section on the standard type
hierarchy. It would be generous if we will supply a link like
http://docs.python.org/reference/datamodel.html;

BTW: it would be even more generous if the page
http://docs.python.org/reference/datamodel.html will include anchors to
specific paragraphs/items, so we could even refer to 
http://docs.python.org/reference/datamodel.html#frame, for example (the
#frame anchor doesn't exist now)

Thanks in advance !

--
assignee: georg.brandl
components: Documentation
messages: 92106
nosy: Yinon, georg.brandl
severity: normal
status: open
title: add link to the documentation of signal.signal

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



[issue3212] ssl module - should test for a wrong cert

2009-08-31 Thread Daniel Black

Daniel Black dan...@cacert.org added the comment:

Is fixed in p3k Mon Sep 8 16:45:19 2008 UTC
http://svn.python.org/view/python/branches/py3k/Lib/test/test_ssl.py?r1=65837r2=66311

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

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



[issue6802] build fails on Snow Leopard

2009-08-31 Thread Mark Dickinson

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

The patch works for me.  Thanks.

--

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



[issue6297] Added Misc/python.pc to 'distclean' Rule

2009-08-31 Thread Mark Dickinson

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

Thanks for the patch.

Applied in r74604 (trunk), r74605 (py3k), r74606 (release31-maint).

--
assignee: georg.brandl - marketdickinson
components: +Build -Documentation
nosy: +marketdickinson
resolution:  - accepted
stage:  - committed/rejected
status: open - closed
versions: +Python 2.7, Python 3.2

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



[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-31 Thread Senthil

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

Fixed and 
Committed revision 74608 - trunk
Committed revision 74609 - py3k

--
resolution:  - fixed

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



[issue6802] build fails on Snow Leopard

2009-08-31 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

With the patch installed, no regressions were seen running my standard set 
of OSX installer builds/installs/regtests on 10.4 and 10.5.

--

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



[issue6811] add a filename argument to marshal.load*

2009-08-31 Thread Brett Cannon

New submission from Brett Cannon br...@python.org:

For compatibility w/ import, importlib needs the ability to set 
code.co_filename to the actual location of the bytecode used to create a 
module and not the path embedded in the marshal data. But since 
co_filename is read-only it can't be done at the moment.

The idea is to add an optional argument to marshal.load* that takes a 
string representing the file path that co_filename should be set to, 
overriding what is in the marshal data.

A long-term perk of this is that eventually this argument can become 
required for marshal.loads() and the file path embedded in the marshal 
data can be removed entirely. marshal.load() would infer its path from 
file.name.

This was all discussed on python-dev; 
http://mail.python.org/pipermail/python-dev/2009-August/091460.html

--
assignee: brett.cannon
components: Extension Modules
messages: 92113
nosy: brett.cannon
priority: low
severity: normal
stage: test needed
status: open
title: add a filename argument to marshal.load*
type: feature request
versions: Python 3.2

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



[issue6811] add a filename argument to marshal.load*

2009-08-31 Thread Fred L. Drake, Jr.

Changes by Fred L. Drake, Jr. fdr...@acm.org:


--
nosy: +fdrake

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



[issue6802] build fails on Snow Leopard

2009-08-31 Thread Jason Montleon

Changes by Jason Montleon mont...@hotmail.com:


--
nosy: +xaoslaad

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



[issue992389] attribute error after non-from import

2009-08-31 Thread Adam Olsen

Adam Olsen rha...@gmail.com added the comment:

The key distinction between this and a bad circular import is that
this is lazy.  You may list the import at the top of your module, but
you never touch it until after you've finished importing yourself (and
they feel the same about you.)

An ugly fix could be done today for module imports by creating a proxy
that triggers the import upon the first attribute access.  A more
general solution could be done with a lazyimport statement, triggered
when the target module finishes importing; only problem there is the
confusing error messages and other oddities if you reassign that name.

--
nosy: +Rhamphoryncus

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



[issue992389] attribute error after non-from import

2009-08-31 Thread Brett Cannon

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

I have done a lazy importer like you describe, Adam, and it does help 
solve this issue. And it does have the problem of import errors being 
triggered rather late and in an odd spot.

--

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



[issue992389] attribute error after non-from import

2009-08-31 Thread Adam Olsen

Adam Olsen rha...@gmail.com added the comment:

It'd probably be sufficient if we raised NameError: lazy import 'foo'
not yet complete.  That should require a set of what names this module
is lazy importing, which is checked in the failure paths of module
attribute lookup and global/builtin lookup.

--

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



[issue6812] Snow Leopard python program fails because _PyType_Modified is missing from python framework

2009-08-31 Thread Seamus O'Shea

New submission from Seamus O'Shea os...@uleth.ca:

Attempts to compile a simple example using XCode 3.2 (Xcode IDE: 1610.0, 
Xcode Core: 1608.0, ToolSupport: 1591.0)under Snow Leopard fail with 
error message 
Traceback (most recent call last):
  File /Users/seamus/Science/xcode exploration/Objc-
programs/First_PyObjC/build/Debug/First_PyObjC.app/Contents/Resources/ma
in.py, line 10, in module
import objc
  File 
/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib
/python/PyObjC/objc/__init__.py, line 22, in module
_update()
  File 
/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib
/python/PyObjC/objc/__init__.py, line 19, in _update
import _objc
ImportError: 
dlopen(/System/Library/Frameworks/Python.framework/Versions/Current/Extr
as/lib/python/PyObjC/objc/_objc.so, 2): Symbol not found: 
_PyType_Modified
  Referenced from: 
/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib/
python/PyObjC/objc/_objc.so
  Expected in: flat namespace
 in 
/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib/
python/PyObjC/objc/_objc.so
2009-08-31 08:31:23.534 First_PyObjC[4072:a0f] *** Terminating app due 
to uncaught exception 'NSInternalInconsistencyException', reason: 
'/Users/seamus/Science/xcode exploration/Objc-
programs/First_PyObjC/main.m:46 main() PyRun_SimpleFile failed with file 
'/Users/seamus/Science/xcode exploration/Objc-
programs/First_PyObjC/build/Debug/First_PyObjC.app/Contents/Resources/ma
in.py'.  See console for errors.'
*** Call stack at first throw:
(
0   CoreFoundation  0x90a1858a __raiseError 
+ 410
1   libobjc.A.dylib 0x9309cf49 
objc_exception_throw + 56
2   CoreFoundation  0x90a182b8 +[NSException 
raise:format:arguments:] + 136
3   CoreFoundation  0x90a1822a +[NSException 
raise:format:] + 58
4   First_PyObjC0x2bc2 main + 1084
5   First_PyObjC0x275a start + 54
)
sharedlibrary apply-load-rules all

The Current Version in the system library is 2.6.

Any suggestions?

--
assignee: ronaldoussoren
components: Macintosh
messages: 92117
nosy: ronaldoussoren, soshea
severity: normal
status: open
title: Snow Leopard python program fails because _PyType_Modified is missing 
from python framework
type: compile error
versions: Python 2.6

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



[issue5639] Support TLS SNI extension in ssl module

2009-08-31 Thread Phil Pennock

Phil Pennock python-...@spodhuis.org added the comment:

(Sorry for dropping this, lost available time)

I see your point.  OTOH, use of SNI needs to be something that can be 
disabled and people need to be able to connect to host A while supplying 
host B, not necessarily using IP addresses for the specificity.  Use-
case example: someone has a service www hosted on [www-1, www-2, 
www-3].  They have an SSL certificate for www and they want to have 
a health-checker which probes for working service, all certs valid and 
not about to expire.

Unless s.connect() gains a keep_original_hostname=False option (?), this 
is hard to do.

Then there's the principle of least surprise -- while it would be nice 
to get SNI working automatically for everyone, it's still plausible that 
amongst the various TLS servers out there are some which break horribly 
for SNI and upgrading Python shouldn't break the tools in use.

So I tend towards favouring make use of the newer, less well tested, 
protocol feature something that has to be explicitly enabled, even if 
it adds a line to boilerplate -- if SNI ever takes over the world (as 
Host: headers in HTTP have) then it can be defaulted on in future 
perhaps?

In which case, if the default is to change, the API should be sorted 
now, so perhaps connect() should take an override_server_hostname=False 
flag, which will make it pass the connect() hostname parameter instead 
of self.server_hostname in the call to _ssl.sslwrap()?  With checking 
for an IP address?

--

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



[issue5468] urlencode does not handle bytes, and could easily handle alternate encodings

2009-08-31 Thread Miles Kaufmann

Changes by Miles Kaufmann mile...@umich.edu:


Removed file: http://bugs.python.org/file14796/urllib_parse.py3k.patch

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



[issue6813] update format() documentation and tutorial

2009-08-31 Thread Daniel Black

New submission from Daniel Black dan...@cacert.org:

Release notes show the use of '{}'.format('this') and the attached patch
updates this to be the default example in the tutorial. Library
references are updated to show field_name as optional and a few examples
are added.

Relates to the improvements from issue 5237.

--
assignee: georg.brandl
components: Documentation
files: documentation-str-format.patch
keywords: patch
messages: 92119
nosy: georg.brandl, grooverdan
severity: normal
status: open
title: update format() documentation and tutorial
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14812/documentation-str-format.patch

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