[issue1444] utf_8_sig streamreader bug, patch, and test

2007-11-15 Thread James G. sack (jim)

New submission from James G. sack (jim):

The streamreader in utf_8_sig.py fails when asked to read a specified 
bytelength of data that ends up in the middle of a multibyte utf8 code.

I will attached a atandalone unittest (which does work from autotest, but 
doesn't use test_support), test_utf8sig_stream.py.

I will attach a patch (applied to the trunk 2.6 version), u8sig26.diff.

Regards,
..jim

--
components: Unicode
files: u8sig26.diff
messages: 57520
nosy: jgsack
severity: normal
status: open
title: utf_8_sig streamreader bug, patch, and test
type: crash
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file8749/u8sig26.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1444
__

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



[issue1444] utf_8_sig streamreader bug, patch, and test

2007-11-15 Thread James G. sack (jim)

Changes by James G. sack (jim):


Added file: http://bugs.python.org/file8750/test_utf8sig_stream.py

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1444
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1430436] recursive __getattr__ in thread crashes BSDs

2007-11-15 Thread bwpy

bwpy added the comment:

I can still reproduce this on FreeBSD 7.0 BETA2.

Python version is
Python 2.5.1 (r251:54863, Nov 14 2007, 13:09:04) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7

--
nosy: +bwpy
versions: +Python 2.5

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1430436
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1328] feature request: force BOM option

2007-11-15 Thread James G. sack (jim)

James G. sack (jim) added the comment:

re: msg57041, I'm sorry if I gave the wrong impression about interacting 
with other programs. I started this feature request with some half-baked 
thinking, which I tried to revise in my second post.

Anyway I'm most interested right now in lobbying for a change to utf_8 to 
accept input with an _optional_ BOM-signature so that the input part would 
behave just like utf_8_sig, where the BOM-sig is already optional (on 
input).

In the process of trying to come up with a test and patch for this, I 
discovered a bug in utf_8_sig (issue #1444 http://bugs.python.org/
issue1444).

After there is some action on that I will return here to continue with 
utf_8, which I have convinced myself (anyways) is a reasonable and safe 
revision.

..jim

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1328
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1444] utf_8_sig streamreader bug, patch, and test

2007-11-15 Thread James G. sack (jim)

James G. sack (jim) added the comment:

Oops, it looks like my patch may have broken test_partial in test_codecs. I 
will try to figure out what the test_partial does in the next day or so, 
unless someone else can add some insignt in the meantime.

.jim

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1444
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1444] utf_8_sig streamreader bug, patch, and test

2007-11-15 Thread James G. sack (jim)

James G. sack (jim) added the comment:

One additional clue: test_codecs succeeds in verbose mode but fails in non-
verbose mode (autotest verbosity) .. I think. My eyes are getting 
blurry. More tomorrow, I guess.

..j

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1444
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1445] SystemError accessing uninitialised cell contents

2007-11-15 Thread Duncan Booth

New submission from Duncan Booth:

The following code throws a SystemError exception. cell_get_contents in
Objects\cellobject.c should check for a null op-ob_ref value and throw
an appropriate exception.

 def oops():
def f(): cell
f.func_closure[0].cell_contents
cell = None


 oops()

Traceback (most recent call last):
  File pyshell#9, line 1, in module
oops()
  File pyshell#8, line 3, in oops
f.func_closure[0].cell_contents
SystemError: error return without exception set


--
components: Interpreter Core
messages: 57525
nosy: duncanb
severity: normal
status: open
title: SystemError accessing uninitialised cell contents
type: behavior
versions: Python 2.5, Python 2.6

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1445
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1144] parsermodule validation out of sync with Grammar

2007-11-15 Thread David Binger

David Binger added the comment:

The one line patch below makes
import parser; parser.sequence2st(parser.suite(class A(object): 
pass).tolist())
work.  It puts the parsermodule's validation back in sync
with the Python3 grammar for this rule of the grammar.

This bug is a serious problem for me.

Index: Modules/parsermodule.c
===
--- Modules/parsermodule.c  (revision 58978)
+++ Modules/parsermodule.c  (working copy)
@@ -992,7 +992,7 @@
 if (res) {
if (nch == 7) {
res = ((validate_lparen(CHILD(tree, 2)) 
-   validate_testlist(CHILD(tree, 3)) 
+   validate_arglist(CHILD(tree, 3)) 
validate_rparen(CHILD(tree, 4;
}
else if (nch == 6) {

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1144
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1328] feature request: force BOM option

2007-11-15 Thread Walter Dörwald

Walter Dörwald added the comment:

jgsack wrote:

 If codec utf_8 or utf_8_sig were to accept input with or without the
 3-byte BOM, and write it as currently specified without/with the BOM
 respectively, then _I_ can reread again with either utf_8 or utf_8_sig.

That's exactly what the utf_8_sig codec does. The decoder accepts input
with or without the BOM (the (first) BOM doesn't get returned). The
encoder always prepends a BOM.

Or do you want a codec that behaves like utf_8 on reading and like
utf_8_sig on writing? Such a codec indead indead wouldn't roundtrip.

--
nosy: +doerwalter

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1328
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1328] feature request: force BOM option

2007-11-15 Thread Walter Dörwald

Walter Dörwald added the comment:

 For utf16, (arguably) a missing BOM should merely assume machian
endianess.
 For utf_16_le, utf_16_be input, both should accept  discard a BOM.
 On output, I'm not sure; maybe all should write a BOM unless passed a flag
 signifying no bom?
 Or to preserve backward compat, could have a parm write_bom defaulting to
 True for utf16 and False for utf_16_le and utf_16_be. This is a 
 modification of the originial request (for a force_bom flag).

The Unicode FAQ (http://unicode.org/faq/utf_bom.html#28) clearly states:


Q: How I should deal with BOMs?
[...]
Where the precise type of the data stream is known (e.g. Unicode
big-endian or Unicode little-endian), the BOM should not be used. In
particular, whenever a data stream is declared to be UTF-16BE, UTF-16LE,
UTF-32BE or UTF-32LE a BOM *must* not be used. [...]

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1328
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1447] patch to make msvccompiler.py work with vs 2005(MSVC8)

2007-11-15 Thread zouguangxian

New submission from zouguangxian:

It seems that the directory information of MSVC8 *just* can be got from 
environment variable instead of registry. 

This patch make me compile pywin32 with MSVC8(VS 2005).

--
files: msvccompiler.py.diff
messages: 57530
nosy: weck
severity: normal
status: open
title: patch to make msvccompiler.py work with vs 2005(MSVC8)
type: compile error
versions: Python 2.5
Added file: http://bugs.python.org/file8752/msvccompiler.py.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1447
__Index: Lib/distutils/msvccompiler.py
===
--- Lib/distutils/msvccompiler.py   (revision 58978)
+++ Lib/distutils/msvccompiler.py   (working copy)
@@ -262,6 +262,7 @@
 self.mc = mc.exe
 else:
 self.__paths = self.get_msvc_paths(path)
+print self.__paths
 
 if len (self.__paths) == 0:
 raise DistutilsPlatformError, \
@@ -610,6 +611,18 @@
 if not _can_read_reg:
 return []
 
+path = path.upper()
+if self.__version == 8:
+if path == PATH:
+return string.split(os.environ[PATH], ;)
+elif path == LIBRARY:
+return string.split(os.environ[LIB], ;) + \
+string.split(os.environ[LIBPATH], ;)
+elif path == INCLUDE:
+return string.split(os.environ[INCLUDE], ;)
+
+
+print self.__root, self.__version
 path = path +  dirs
 if self.__version = 7:
 key = (r%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories
@@ -618,6 +631,7 @@
 key = (r%s\6.0\Build System\Components\Platforms
r\Win32 (%s)\Directories % (self.__root, platform))
 
+print key
 for base in HKEYS:
 d = read_values(base, key)
 if d:
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1449] make msi work the vs 2005(MSVC8)

2007-11-15 Thread zouguangxian

New submission from zouguangxian:

with vs 2003, msi.py get msvcr71.dll from msm. but with vs 2005, It's 
better to extract msvcr80.dll from %VCINTALLDIR%\redist\x86
\Microsoft.VC80.CRT\. In addition, it seems to extract file from 
Microsoft_VC80_CRT_x86.msm need upgrade MSI to 3.1, i am not sure.

I 'PCbuild' to 'PCbuild8' in msi.py and add extract_msvcr80, that will 
make msi.py work with vs 2005.

--
files: msi.patch
messages: 57532
nosy: weck
severity: normal
status: open
title: make msi  work the vs 2005(MSVC8)
type: compile error
versions: Python 2.5
Added file: http://bugs.python.org/file8754/msi.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1449
__Index: msi.py
===
--- msi.py  (revision 58978)
+++ msi.py  (working copy)
@@ -1,7 +1,7 @@
 # Python MSI Generator
 # (C) 2003 Martin v. Loewis
 # See FOO in comments refers to MSDN sections with the title FOO.
-import msilib, schema, sequence, os, glob, time, re
+import msilib, schema, sequence, os, glob, time, re, shutil
 from msilib import Feature, CAB, Directory, Dialog, Binary, add_data
 import uisample
 from win32com.client import constants
@@ -25,7 +25,7 @@
 # Is Tcl available at all?
 have_tcl = True
 # Where is sqlite3.dll located, relative to srcdir?
-sqlite_dir = ../sqlite-source-3.3.4
+sqlite_dir = ../sqlite-3.5.2
 
 try:
 from config import *
@@ -101,6 +101,7 @@
 # Using the same UUID is fine since these files are versioned,
 # so Installer will always keep the newest version.
 msvcr71_uuid = {8666C8DD-D0B4-4B42-928E-A69E32FA5D4D}
+msvcr80_uuid = {82a0ee70-92d0-11dc-a156-0015c53a55e7}
 pythondll_uuid = {
 24:{9B81E618-2301-4035-AC77-75D9ABEB7301},
 25:{2e41b118-38bd-4c1b-a840-6977efd1b911}
@@ -144,16 +145,16 @@
 
 return True
 
-# Target files (.def and .a) go in PCBuild directory
-lib_file = os.path.join(srcdir, PCBuild, python%s%s.lib % (major, minor))
-def_file = os.path.join(srcdir, PCBuild, python%s%s.def % (major, minor))
+# Target files (.def and .a) go in PCBuild8 directory
+lib_file = os.path.join(srcdir, PCBuild8, python%s%s.lib % (major, minor))
+def_file = os.path.join(srcdir, PCBuild8, python%s%s.def % (major, minor))
 dll_file = python%s%s.dll % (major, minor)
-mingw_lib = os.path.join(srcdir, PCBuild, libpython%s%s.a % (major, minor))
+mingw_lib = os.path.join(srcdir, PCBuild8, libpython%s%s.a % (major, 
minor))
 
 have_mingw = build_mingw_lib(lib_file, def_file, dll_file, mingw_lib)
 
 # Determine the target architechture
-dll_path = os.path.join(srcdir, PCBuild, dll_file)
+dll_path = os.path.join(srcdir, PCBuild8, dll_file)
 msilib.set_arch_from_file(dll_path)
 if msilib.pe_type(dll_path) != msilib.pe_type(msisupport.dll):
 raise SystemError, msisupport.dll for incorrect architecture
@@ -827,6 +828,32 @@
 return installer.FileVersion(msvcr71.dll, 0), \
installer.FileVersion(msvcr71.dll, 1)
 
+
+def extract_msvcr80():
+import _winreg
+# Find the location of the merge modules
+k = _winreg.OpenKey(
+_winreg.HKEY_LOCAL_MACHINE,
+rSoftware\Microsoft\VisualStudio\8.0\Setup\VS)
+prod_dir = _winreg.QueryValueEx(k, ProductDir)[0]
+_winreg.CloseKey(k)
+
+# Copy msvcr80*
+dir = os.path.join(prod_dir, 'VC\\redist\\x86\\Microsoft.VC80.CRT')
+files = glob.glob1(dir, *CRT*) + glob.glob1(dir, *VCR*) 
+for x in files:
+print x
+shutil.copy(os.path.join(dir, x), '.')
+
+dir = os.path.join(prod_dir, 
'VC\\redist\\Debug_NonRedist\\x86\\Microsoft.VC80.DebugCRT')
+files = glob.glob1(dir, *CRT*) + glob.glob1(dir, *VCR*) 
+for x in files:
+print x
+shutil.copy(os.path.join(dir, x), '.')
+
+# Find the version/language of msvcr80.dll
+return '8.00.50727.42', 'english'
+
 class PyDirectory(Directory):
 By default, all components in the Python installer
 can run from source.
@@ -844,19 +871,19 @@
 root = PyDirectory(db, cab, None, srcdir, TARGETDIR, SourceDir)
 default_feature.set_current()
 if not msilib.Win64:
-root.add_file(PCBuild/w9xpopen.exe)
+root.add_file(PCBuild8/w9xpopen.exe)
 root.add_file(README.txt, src=README)
 root.add_file(NEWS.txt, src=Misc/NEWS)
 root.add_file(LICENSE.txt, src=LICENSE)
 root.start_component(python.exe, keyfile=python.exe)
-root.add_file(PCBuild/python.exe)
+root.add_file(PCBuild8/python.exe)
 root.start_component(pythonw.exe, keyfile=pythonw.exe)
-root.add_file(PCBuild/pythonw.exe)
+root.add_file(PCBuild8/pythonw.exe)
 
 # msidbComponentAttributesSharedDllRefCount = 8, see Component Table
 dlldir = PyDirectory(db, cab, root, srcdir, DLLDIR, .)
 pydll = python%s%s.dll % (major, minor)
-pydllsrc = srcdir + /PCBuild/ + pydll
+pydllsrc = srcdir + /PCBuild8/ + pydll
 dlldir.start_component(DLLDIR, flags = 8, keyfile = pydll, 

[issue1450] make modulator more general

2007-11-15 Thread zouguangxian

New submission from zouguangxian:

modulator may be outdated. i made a changement to make it use the new 
feature of PyTypeObject in Python2.5.

for example, to support members, methods, new, init and etc.

--
components: Demos and Tools
files: modulator.patch
messages: 57533
nosy: weck
severity: normal
status: open
title: make modulator more general
type: compile error
versions: Python 2.5
Added file: http://bugs.python.org/file8755/modulator.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1450
__Index: genmodule.py
===
--- genmodule.py(revision 58978)
+++ genmodule.py(working copy)
@@ -27,7 +27,9 @@
 # Names of functions in the object-description struct.
 #
 FUNCLIST = ['new', 'tp_dealloc', 'tp_print', 'tp_getattr', 'tp_setattr',
-'tp_compare', 'tp_repr', 'tp_hash', 'tp_call', 'tp_str']
+'tp_compare', 'tp_repr', 'tp_hash', 'tp_call', 'tp_str', 
+'tp_methods', 'tp_members', 'tp_init', 'tp_new', 'tp_traverse',
+'tp_clear']
 TYPELIST = ['tp_as_number', 'tp_as_sequence', 'tp_as_mapping', 'structure']
 
 #
@@ -92,6 +94,7 @@
 self.typelist = []
 self.methodlist = []
 self.funclist = ['new']
+self.memberlist = []
 writer.__init__(self)
 
 def writecode(self, fp):
@@ -100,10 +103,36 @@
 self.writebody(fp)
 
 def writehead(self, fp):
+saved = self.memberlist
+new_ml = ''
+for fn in self.memberlist:
+self.member = fn
+new_ml = new_ml + (
+  'XXX %s;\n'
+  %(fn))
+self.memberlist = new_ml
 self.addcode('object_head', fp)
+self.memberlist = saved
 
 def writebody(self, fp):
 new_ml = ''
+for fn in self.memberlist:
+self.member = fn
+print 'member', fn
+self.addcode('object_member', fp)
+new_ml = new_ml + (
+  '{%s,\tT_XXX, 
offsetof(%sObject,%s),\t0,\t%s_%s__doc__},\n'
+  %(fn, self.abbrev, fn, self.abbrev, fn))
+self.memberlist = new_ml
+
+if len(self.memberlist)  0 :
+self.addcode('object_mlist2', fp)
+
+# Add tp_members if we have methods
+if self.memberlist and not 'tp_members' in self.funclist:
+self.funclist.insert(0, 'tp_members')
+
+new_ml = ''
 for fn in self.methodlist:
 self.method = fn
 self.addcode('object_method', fp)
@@ -113,9 +142,9 @@
 self.methodlist = new_ml
 self.addcode('object_mlist', fp)
 
-# Add getattr if we have methods
-if self.methodlist and not 'tp_getattr' in self.funclist:
-self.funclist.insert(0, 'tp_getattr')
+# Add tp_methods if we have methods
+if self.methodlist and not 'tp_methods' in self.funclist:
+self.funclist.insert(0, 'tp_methods')
 
 for fn in FUNCLIST:
 setattr(self, fn, '0')
@@ -133,6 +162,13 @@
 self.funclist.remove('tp_setattr')
 self.tp_getattr = self.abbrev + '_getattr'
 self.tp_setattr = self.abbrev + '_setattr'
+
+if 'tp_dealloc' in self.funclist:
+if 'tp_traverse' not in self.funclist:
+self.funclist.insert(0, 'tp_traverse')
+if 'tp_clear' not in self.funclist:
+self.funclist.insert(0, 'tp_clear')
+
 for fn in self.funclist:
 self.addcode('object_'+fn, fp)
 setattr(self, fn, '%s_%s'%(self.abbrev, fn[3:]))
Index: modulator.py
===
--- modulator.py(revision 58978)
+++ modulator.py(working copy)
@@ -18,7 +18,7 @@
 
 import sys, os
 if os.name  'mac':
-sys.path.append(os.path.join(os.environ['HOME'],
+sys.path.append(os.path.join(os.environ['HOMEPATH'],
  'src/python/Tools/modulator'))
 
 from Tkinter import *
@@ -108,7 +108,14 @@
 if not fn:
 return
 
+root, ext = os.path.splitext(fn)
+
 fp = open(fn, 'w')
+pycode = pycode + \n
+fp = open('%s', 'w')
+genmodule.write(fp, m)
+fp.close()
+ % ( root + '.c' )
 
 fp.write(pycode)
 fp.close()
@@ -210,7 +217,7 @@
 raise oops
 
 def gencode(self, name, objects):
-rv = ''
+rv = 'import genmodule\n'
 self.synchronize()
 for o in objects:
 o.synchronize()
Index: Templates/copyright
===
--- Templates/copyright (revision 58978)
+++ Templates/copyright (working copy)
@@ -0,0 +1,3 @@
+// WePlay Inc.
+// 
+
Index: Templates/module_head

[issue1449] make msi work the vs 2005(MSVC8)

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

I'm resetting the target version of all your MSVC patches to 2.6 + 3.0.
While we can't alter the compiler version of Python 2.5 I really like to
update to a new compiler for 2.6 and 3.0.

--
components: +Demos and Tools, Installation
keywords: +patch
nosy: +tiran
priority:  - normal
versions: +Python 2.6, Python 3.0 -Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1449
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1448] Build Python with VS 2005(MSVC8)

2007-11-15 Thread Christian Heimes

Changes by Christian Heimes:


--
components: +Installation
keywords: +patch
priority:  - normal
versions: +Python 2.6, Python 3.0 -Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1448
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1447] patch to make msvccompiler.py work with vs 2005(MSVC8)

2007-11-15 Thread Christian Heimes

Changes by Christian Heimes:


--
components: +Installation
keywords: +patch
versions: +Python 2.6, Python 3.0 -Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1447
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1444] utf_8_sig streamreader bug, patch, and test

2007-11-15 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1444
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1447] patch to make msvccompiler.py work with vs 2005(MSVC8)

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

I've checked your patch. It's not enough to move to VS 2005 as the
default compiler. People expect python setup.py to work w/o opening a VS
2005 Command Prompt.

--
nosy: +tiran

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1447
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1444] utf_8_sig streamreader bug, patch, and test

2007-11-15 Thread Georg Brandl

Changes by Georg Brandl:


--
assignee:  - doerwalter
nosy: +doerwalter

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1444
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446] Link to call me for free

2007-11-15 Thread Christian Heimes

Changes by Christian Heimes:


--
resolution:  - invalid
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1446
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1450] make modulator more general

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your work! I'm changing the version number to Python 2.6.
It's too late to get it into Python 2.5.

Christian

PS: Next time could you please create the patch in the root of the
Python source tree? It makes it easier to apply the patch.

--
keywords: +patch
nosy: +tiran
priority:  - normal
versions: +Python 2.6 -Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1450
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1449] make msi work the vs 2005(MSVC8)

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

The patch looks fine but I've a small request. Could you please use a
global var PCBUILD instead of PCBuild / PCBuild8 and change the
dependencies to use either MSVCR 71 or 80 depending on the content of
the var. This way the msi module can handle both versions.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1449
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1448] Build Python with VS 2005(MSVC8)

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

I'm a bit concerned with the upgrade from DB 4.4. to 4.6 and SQLite from
3.3 to 3.5. Are the APIs backward compatible or can the Python bindings
handle the new APIs? I believe that Python 2.6 is compatible with db4.6
but I'm not sure about SQLite. Have you run the unit tests?

--
nosy: +tiran

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1448
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1144] parsermodule validation out of sync with Grammar

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Can you submit a unittest that catches this? Then I can check in the fix.

--
assignee: fdrake - gvanrossum

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1144
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1451] SSL patch for Python 3000

2007-11-15 Thread Bill Janssen

Bill Janssen added the comment:

I've tried several different times to fix that warning.  It appears on
some releases of gcc, and not on others.  There seems to be no cast or
declaration that fixes it everywhere.  More power to you if you can
find one!

Bill

On 11/15/07, Christian Heimes [EMAIL PROTECTED] wrote:

 Christian Heimes added the comment:

 Ubuntu Linux 7.10, x86, gcc version 4.1.3 20070929 (prerelease) (Ubuntu
 4.1.2-16ubuntu2)


 /home/heimes/dev/python/py3k/Modules/_ssl.c: In function
 '_get_peer_alt_names':
 /home/heimes/dev/python/py3k/Modules/_ssl.c:680: warning: passing
 argument 2 of 'ASN1_item_d2i' from incompatible pointer type
 /home/heimes/dev/python/py3k/Modules/_ssl.c:684: warning: passing
 argument 2 of 'method-d2i' from incompatible pointer type
 gcc -pthread -shared

 --
 nosy: +tiran

 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1451
 __


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1451
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Christian Heimes

Changes by Christian Heimes:


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

Oh, I forgot

Added file: http://bugs.python.org/file8757/py3k_another_socket.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__Index: Include/longobject.h
===
--- Include/longobject.h	(revision 58972)
+++ Include/longobject.h	(working copy)
@@ -26,6 +26,15 @@
 PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
 PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
 
+/* Used by socketmodule.c */
+#if SIZEOF_SOCKET_T = SIZEOF_LONG
+#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLong(fd)
+#else
+#define PyLong_FromSocket_t(fd) PyLong_FromLongLong(((SOCKET_T)(fd));
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd)
+#endif
+
 /* For use by intobject.c only */
 PyAPI_DATA(int) _PyLong_DigitValue[256];
 
Index: Lib/socket.py
===
--- Lib/socket.py	(revision 58972)
+++ Lib/socket.py	(working copy)
@@ -79,28 +79,14 @@
 __all__.append(errorTab)
 
 
-# True if os.dup() can duplicate socket descriptors.
-# (On Windows at least, os.dup only works on files)
-_can_dup_socket = hasattr(_socket.socket, dup)
-
-if _can_dup_socket:
-def fromfd(fd, family=AF_INET, type=SOCK_STREAM, proto=0):
-nfd = os.dup(fd)
-return socket(family, type, proto, fileno=nfd)
-
 class socket(_socket.socket):
 
 A subclass of _socket.socket adding the makefile() method.
 
 __slots__ = [__weakref__, _io_refs, _closed]
-if not _can_dup_socket:
-__slots__.append(_base)
 
 def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None):
-if fileno is None:
-_socket.socket.__init__(self, family, type, proto)
-else:
-_socket.socket.__init__(self, family, type, proto, fileno)
+_socket.socket.__init__(self, family, type, proto, fileno)
 self._io_refs = 0
 self._closed = False
 
@@ -114,23 +100,27 @@
 s[7:])
 return s
 
+def dup(self):
+dup() - socket object
+
+Return a new socket object connected to the same system resource.
+
+fd = self._dup()
+return self.__class__(self.family, self.type, self.proto, fileno=fd)
+
 def accept(self):
-Wrap accept() to give the connection the right type.
-conn, addr = _socket.socket.accept(self)
-fd = conn.fileno()
-nfd = fd
-if _can_dup_socket:
-nfd = os.dup(fd)
-wrapper = socket(self.family, self.type, self.proto, fileno=nfd)
-if fd == nfd:
-wrapper._base = conn  # Keep the base alive
-else:
-conn.close()
-return wrapper, addr
+accept() - (socket object, address info)
 
+Wait for an incoming connection.  Return a new socket
+representing the connection, and the address of the client.
+For IP sockets, the address info is a pair (hostaddr, port).
+
+fd, addr = self._accept()
+return socket(self.family, self.type, self.proto, fileno=fd), addr
+
 def makefile(self, mode=r, buffering=None, *,
  encoding=None, newline=None):
-Return an I/O stream connected to the socket.
+makefile(...) - an I/O stream connected to the socket
 
 The arguments are as for io.open() after the filename,
 except the only mode characters supported are 'r', 'w' and 'b'.
@@ -184,21 +174,8 @@
 
 def close(self):
 self._closed = True
-if self._io_refs  1:
-self._real_close()
-
-# _real_close calls close on the _socket.socket base class.
-
-if not _can_dup_socket:
-def _real_close(self):
+if self._io_refs = 0:
 _socket.socket.close(self)
-base = getattr(self, _base, None)
-if base is not None:
-self._base = None
-base.close()
-else:
-def _real_close(self):
-_socket.socket.close(self)
 
 
 class SocketIO(io.RawIOBase):
Index: Lib/test/test_socket.py
===
--- Lib/test/test_socket.py	(revision 58972)
+++ Lib/test/test_socket.py	(working copy)
@@ -575,6 +575,15 @@
 def _testFromFd(self):
 self.serv_conn.send(MSG)
 
+def testDup(self):
+# Testing dup()
+sock = self.cli_conn.dup()
+msg = sock.recv(1024)
+self.assertEqual(msg, MSG)
+
+def _testDup(self):
+self.serv_conn.send(MSG)
+
 def testShutdown(self):
 # Testing shutdown()
 msg = self.cli_conn.recv(1024)
Index: Modules/socketmodule.c
===
--- Modules/socketmodule.c	(revision 58972)
+++ 

[issue1144] parsermodule validation out of sync with Grammar

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Committed revision 58987.

--
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1144
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1448] Build Python with VS 2005(MSVC8)

2007-11-15 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I'm rejecting this patch, for several reasons:
- it addresses too many issues in a single patch. Separate bug reports
need to be submitted for independent issues.
- for each issue, it fails to explain what the problem is. For example,
some libraries are outdated is not a problem per se, but only would be
a problem if those old libraries don't work with the new compiler; the
actual problem is not reported here.
- it suggests to upgrade libraries; I assume it does so for Python 2.6
and 3.0. However, upgrading libraries should be deferred until before
the release. People building the development versions of Python are
expected to arrange the build environment themselves in a way they like,
using readme.txt only as a guideline.
- the patches to upgrade the libraries are incomplete.

--
nosy: +loewis
resolution:  - rejected
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1448
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1451] SSL patch for Python 3000

2007-11-15 Thread Bill Janssen

Bill Janssen added the comment:

Actually, it's some combination of the version of OpenSSL plus the
version of gcc.

Bill

On 11/15/07, Bill Janssen [EMAIL PROTECTED] wrote:
 I've tried several different times to fix that warning.  It appears on
 some releases of gcc, and not on others.  There seems to be no cast or
 declaration that fixes it everywhere.  More power to you if you can
 find one!

 Bill

 On 11/15/07, Christian Heimes [EMAIL PROTECTED] wrote:
 
  Christian Heimes added the comment:
 
  Ubuntu Linux 7.10, x86, gcc version 4.1.3 20070929 (prerelease) (Ubuntu
  4.1.2-16ubuntu2)
 
 
  /home/heimes/dev/python/py3k/Modules/_ssl.c: In function
  '_get_peer_alt_names':
  /home/heimes/dev/python/py3k/Modules/_ssl.c:680: warning: passing
  argument 2 of 'ASN1_item_d2i' from incompatible pointer type
  /home/heimes/dev/python/py3k/Modules/_ssl.c:684: warning: passing
  argument 2 of 'method-d2i' from incompatible pointer type
  gcc -pthread -shared
 
  --
  nosy: +tiran
 
  __
  Tracker [EMAIL PROTECTED]
  http://bugs.python.org/issue1451
  __
 


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1451
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1451] SSL patch for Python 3000

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

Ubuntu Linux 7.10, x86, gcc version 4.1.3 20070929 (prerelease) (Ubuntu
4.1.2-16ubuntu2)


/home/heimes/dev/python/py3k/Modules/_ssl.c: In function
'_get_peer_alt_names':
/home/heimes/dev/python/py3k/Modules/_ssl.c:680: warning: passing
argument 2 of 'ASN1_item_d2i' from incompatible pointer type
/home/heimes/dev/python/py3k/Modules/_ssl.c:684: warning: passing
argument 2 of 'method-d2i' from incompatible pointer type
gcc -pthread -shared

--
nosy: +tiran

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1451
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread roudkerk

roudkerk added the comment:

From Guido's patch:
if (!DuplicateHandle(GetCurrentProcess(), (HANDLE)handle, 
 GetCurrentProcess(), newhandle,
 0, FALSE, DUPLICATE_SAME_ACCESS)) 
{
WSASetLastError(GetLastError());
return INVALID_SOCKET;
}

If you are going to use GetLastError() like that then you really
should change set_error() so that it recognizes non-WSA errors.

The solution is easy: rip out the 80+ lines of Windows specific code
in set_error() and replace them by the much simpler

#ifdef MS_WINDOWS
int err_no = WSAGetLastError();
/* PyErr_SetExcFromWindowsErr() invokes FormatMessage() which
   recognizes the error numbers used by both GetLastError() 
   and WSAGetLastError() */
if (err_no)
return PyErr_SetExcFromWindowsErr(socket_error, err_no);
#endif

Note that if you make makefile() use a duplicate socket then you can
also remove all the reference counting stuff from the socket subclass.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1447] patch to make msvccompiler.py work with vs 2005(MSVC8)

2007-11-15 Thread Martin v. Löwis

Martin v. Löwis added the comment:

tiran is correct. distutils should work without having to invoke a VS
build environment. Relying on that environment would have worked way
back to VC6 and earlier, but it would reduce the ease of use of distutils.

Rejecting the patch.

--
nosy: +loewis
resolution:  - rejected
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1447
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

roudkerk, can you turn that suggestion into a proper patch?

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1144] parsermodule validation out of sync with Grammar

2007-11-15 Thread David Binger

David Binger added the comment:

Okay, here is the whole thing with a unittest that exposes the problem.

Index: Lib/test/test_parser.py
===
--- Lib/test/test_parser.py (revision 58984)
+++ Lib/test/test_parser.py (working copy)
@@ -136,6 +136,7 @@
 
 def test_class_defs(self):
 self.check_suite(class foo():pass)
+self.check_suite(class foo(object):pass)
 
 def test_import_from_statement(self):
 self.check_suite(from sys.path import *)
Index: Modules/parsermodule.c
===
--- Modules/parsermodule.c  (revision 58984)
+++ Modules/parsermodule.c  (working copy)
@@ -992,7 +992,7 @@
 if (res) {
if (nch == 7) {
res = ((validate_lparen(CHILD(tree, 2)) 
-   validate_testlist(CHILD(tree, 3)) 
+   validate_arglist(CHILD(tree, 3)) 
validate_rparen(CHILD(tree, 4;
}
else if (nch == 6) {

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1144
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1449] make msi work the vs 2005(MSVC8)

2007-11-15 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I'm opposed to this patch. Any change to the MSI build process should
only be made when/after the default compiler for Python is changed. That
needs to be discussed on python-dev first, and I hope that the new build
infrastructure will *not* use the PCbuild8 directory (but perhaps move
rename that directory to PCbuild instead, or just upgrade the project
files in PCbuild).

In addition, I hope that VS 2005 will *not* be the next default compiler
for Python, but that VS 2008 will be the new compiler.

--
nosy: +loewis

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1449
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Forgot to upload socket3.diff.

Added file: http://bugs.python.org/file8759/socket3.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__Index: Include/longobject.h
===
--- Include/longobject.h	(revision 58987)
+++ Include/longobject.h	(working copy)
@@ -26,6 +26,15 @@
 PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
 PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
 
+/* Used by socketmodule.c */
+#if SIZEOF_SOCKET_T = SIZEOF_LONG
+#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLong(fd)
+#else
+#define PyLong_FromSocket_t(fd) PyLong_FromLongLong(((SOCKET_T)(fd));
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd)
+#endif
+
 /* For use by intobject.c only */
 PyAPI_DATA(int) _PyLong_DigitValue[256];
 
Index: Lib/socket.py
===
--- Lib/socket.py	(revision 58987)
+++ Lib/socket.py	(working copy)
@@ -79,28 +79,19 @@
 __all__.append(errorTab)
 
 
-# True if os.dup() can duplicate socket descriptors.
-# (On Windows at least, os.dup only works on files)
-_can_dup_socket = hasattr(_socket.socket, dup)
+def socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None):
+Factory function for socket objects.
+return Socket(family, type, proto, fileno)
 
-if _can_dup_socket:
-def fromfd(fd, family=AF_INET, type=SOCK_STREAM, proto=0):
-nfd = os.dup(fd)
-return socket(family, type, proto, fileno=nfd)
 
-class socket(_socket.socket):
+class Socket(_socket.socket):
 
 A subclass of _socket.socket adding the makefile() method.
 
 __slots__ = [__weakref__, _io_refs, _closed]
-if not _can_dup_socket:
-__slots__.append(_base)
 
 def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None):
-if fileno is None:
-_socket.socket.__init__(self, family, type, proto)
-else:
-_socket.socket.__init__(self, family, type, proto, fileno)
+_socket.socket.__init__(self, family, type, proto, fileno)
 self._io_refs = 0
 self._closed = False
 
@@ -114,23 +105,27 @@
 s[7:])
 return s
 
+def dup(self):
+dup() - socket object
+
+Return a new socket object connected to the same system resource.
+
+fd = dup(self.fileno())
+return self.__class__(self.family, self.type, self.proto, fileno=fd)
+
 def accept(self):
-Wrap accept() to give the connection the right type.
-conn, addr = _socket.socket.accept(self)
-fd = conn.fileno()
-nfd = fd
-if _can_dup_socket:
-nfd = os.dup(fd)
-wrapper = socket(self.family, self.type, self.proto, fileno=nfd)
-if fd == nfd:
-wrapper._base = conn  # Keep the base alive
-else:
-conn.close()
-return wrapper, addr
+accept() - (socket object, address info)
 
+Wait for an incoming connection.  Return a new socket
+representing the connection, and the address of the client.
+For IP sockets, the address info is a pair (hostaddr, port).
+
+fd, addr = self._accept()
+return Socket(self.family, self.type, self.proto, fileno=fd), addr
+
 def makefile(self, mode=r, buffering=None, *,
  encoding=None, newline=None):
-Return an I/O stream connected to the socket.
+makefile(...) - an I/O stream connected to the socket
 
 The arguments are as for io.open() after the filename,
 except the only mode characters supported are 'r', 'w' and 'b'.
@@ -148,8 +143,8 @@
 rawmode += r
 if writing:
 rawmode += w
-raw = SocketIO(self, rawmode)
-self._io_refs += 1
+sock = self.dup()
+raw = SocketIO(sock, rawmode)
 if buffering is None:
 buffering = -1
 if buffering  0:
@@ -157,7 +152,7 @@
 if buffering == 0:
 if not binary:
 raise ValueError(unbuffered streams must be binary)
-raw.name = self.fileno()
+raw.name = sock.fileno()
 raw.mode = mode
 return raw
 if reading and writing:
@@ -168,39 +163,25 @@
 assert writing
 buffer = io.BufferedWriter(raw, buffering)
 if binary:
-buffer.name = self.fileno()
+buffer.name = sock.fileno()
 buffer.mode = mode
 return buffer
 text = io.TextIOWrapper(buffer, encoding, newline)
-text.name = self.fileno()
+text.name = sock.fileno()
 text.mode = mode
 return text
 
-def _decref_socketios(self):
-if self._io_refs  0:
-  

[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

socket3.diff builds on socket2.diff:

- Rename socket class to Socket; add socket() as a factory function.

- Implement roudkerk's suggestion of using a duplicate socket in
makefile() to get rid of the manual reference counting. Yay!

Note: this dinterferes with Bill Janssen's issue 1451.  Whichever is
checked in last must fix issues with the other.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

socket2.diff makes dup() a module-level function in _socket (and hence
in socket.py) and uses that to implement fromfd() in socket.py.

No changes otherwise compared to py3k_another_socket.patch.

Added file: http://bugs.python.org/file8758/socket2.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__Index: Include/longobject.h
===
--- Include/longobject.h	(revision 58987)
+++ Include/longobject.h	(working copy)
@@ -26,6 +26,15 @@
 PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
 PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
 
+/* Used by socketmodule.c */
+#if SIZEOF_SOCKET_T = SIZEOF_LONG
+#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLong(fd)
+#else
+#define PyLong_FromSocket_t(fd) PyLong_FromLongLong(((SOCKET_T)(fd));
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd)
+#endif
+
 /* For use by intobject.c only */
 PyAPI_DATA(int) _PyLong_DigitValue[256];
 
Index: Lib/socket.py
===
--- Lib/socket.py	(revision 58987)
+++ Lib/socket.py	(working copy)
@@ -79,28 +79,14 @@
 __all__.append(errorTab)
 
 
-# True if os.dup() can duplicate socket descriptors.
-# (On Windows at least, os.dup only works on files)
-_can_dup_socket = hasattr(_socket.socket, dup)
-
-if _can_dup_socket:
-def fromfd(fd, family=AF_INET, type=SOCK_STREAM, proto=0):
-nfd = os.dup(fd)
-return socket(family, type, proto, fileno=nfd)
-
 class socket(_socket.socket):
 
 A subclass of _socket.socket adding the makefile() method.
 
 __slots__ = [__weakref__, _io_refs, _closed]
-if not _can_dup_socket:
-__slots__.append(_base)
 
 def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None):
-if fileno is None:
-_socket.socket.__init__(self, family, type, proto)
-else:
-_socket.socket.__init__(self, family, type, proto, fileno)
+_socket.socket.__init__(self, family, type, proto, fileno)
 self._io_refs = 0
 self._closed = False
 
@@ -114,23 +100,27 @@
 s[7:])
 return s
 
+def dup(self):
+dup() - socket object
+
+Return a new socket object connected to the same system resource.
+
+fd = dup(self.fileno())
+return self.__class__(self.family, self.type, self.proto, fileno=fd)
+
 def accept(self):
-Wrap accept() to give the connection the right type.
-conn, addr = _socket.socket.accept(self)
-fd = conn.fileno()
-nfd = fd
-if _can_dup_socket:
-nfd = os.dup(fd)
-wrapper = socket(self.family, self.type, self.proto, fileno=nfd)
-if fd == nfd:
-wrapper._base = conn  # Keep the base alive
-else:
-conn.close()
-return wrapper, addr
+accept() - (socket object, address info)
 
+Wait for an incoming connection.  Return a new socket
+representing the connection, and the address of the client.
+For IP sockets, the address info is a pair (hostaddr, port).
+
+fd, addr = self._accept()
+return socket(self.family, self.type, self.proto, fileno=fd), addr
+
 def makefile(self, mode=r, buffering=None, *,
  encoding=None, newline=None):
-Return an I/O stream connected to the socket.
+makefile(...) - an I/O stream connected to the socket
 
 The arguments are as for io.open() after the filename,
 except the only mode characters supported are 'r', 'w' and 'b'.
@@ -184,23 +174,20 @@
 
 def close(self):
 self._closed = True
-if self._io_refs  1:
-self._real_close()
+if self._io_refs = 0:
+_socket.socket.close(self)
 
-# _real_close calls close on the _socket.socket base class.
 
-if not _can_dup_socket:
-def _real_close(self):
-_socket.socket.close(self)
-base = getattr(self, _base, None)
-if base is not None:
-self._base = None
-base.close()
-else:
-def _real_close(self):
-_socket.socket.close(self)
+def fromfd(fd, family, type, proto=0):
+ fromfd(fd, family, type[, proto]) - socket object
 
+Create a socket object from a duplicate of the given file
+descriptor.  The remaining arguments are the same as for socket().
+
+nfd = dup(fd)
+return socket(family, type, proto, nfd)
 
+
 class SocketIO(io.RawIOBase):
 
 Raw I/O implementation for stream sockets.
Index: Lib/test/test_socket.py
===
--- Lib/test/test_socket.py	(revision 58987)
+++ 

[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

 I've reviewed your patch and merged it was some pending changes of my
 own. The socket tests are passing on Windows. Great work :)

You didn't upload this though.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1430436] recursive __getattr__ in thread crashes

2007-11-15 Thread Brett Cannon

Brett Cannon added the comment:

And under 2.6 on OS X.  I doubt this is a BSD thing but more of a
recursion depth issue.

And I don't think there is anything to fix here.  The recursion depth is
a per-thread thing, and this test is blowing the C stack before the
recursion depth is reached.  If you drop the recursion limit lower the
proper exception is raised (I had to drop mine down to 400 to trigger
the exception).

So this is not a Python issue, per-se, just a limitation of the C stack
and how things are implemented.  While we do everything we can to
prevent crashes, this just can't be helped as the C stack is not under
our control.

Closing as invalid.

--
nosy: +brett.cannon
resolution:  - invalid
status: open - closed
title: recursive __getattr__ in thread crashes BSDs - recursive __getattr__ in 
thread crashes
versions: +Python 2.6

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1430436
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

- I'm hoping that Bill can submit his SSL changes first.

- If we make _dup() a module-level function, we can implement fromfd()
in Python. I'll do this now.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1031213] Use correct encoding for printing SyntaxErrors

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

 In release25-maint, PyErr_Print() should be replaced with
 PyErr_Clear() also.

Committed revision 58991.

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1451] SSL patch for Python 3000

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

If you haven't checked this in by tomorrow morning, I'll submit issue
1378 (socket3.diff) first, and you'll have to do a bunch of cleanup. 
Or, if you like, I can submit that now and you can do the cleanup this
afternoon.  (Basically, we can dup() sockets on Windows now, so all the
nonsense about keeping our own reference counts is no longer needed --
makefile() just hangs on to a dup() of the socket. This restores the
semantics we had in 1.5.2...

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1451
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1417] Weakref not working properly

2007-11-15 Thread MHOOO

MHOOO added the comment:

Yeah, cool :)
Thanks =)

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1445] SystemError accessing uninitialised cell contents

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Patch anyone?

--
nosy: +gvanrossum

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1445
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1451] SSL patch for Python 3000

2007-11-15 Thread Bill Janssen

Bill Janssen added the comment:

I'll check it in this afternoon -- I've just got to figure out how to
run the Python clean-up tool.  Then you can check in the socket3.diff
patch, then I'll make sure the SSL module works with that version of
sockets.

Bill

On 11/15/07, Guido van Rossum [EMAIL PROTECTED] wrote:

 Guido van Rossum added the comment:

 If you haven't checked this in by tomorrow morning, I'll submit issue
 1378 (socket3.diff) first, and you'll have to do a bunch of cleanup.
 Or, if you like, I can submit that now and you can do the cleanup this
 afternoon.  (Basically, we can dup() sockets on Windows now, so all the
 nonsense about keeping our own reference counts is no longer needed --
 makefile() just hangs on to a dup() of the socket. This restores the
 semantics we had in 1.5.2...

 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1451
 __


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1451
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1449] make msi work the vs 2005(MSVC8)

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

Weck,

if you like to help and spend some time on getting VS2008 support into
Python 2.6 and 3.0 I'm willing to assist you. You can download the Beta
2 of the VS C++ 2008 Express Edition from
http://msdn2.microsoft.com/en-us/express/future/bb421473.aspx

IMHO the order of things to do is:

* Get Python 2.6 and all dependencies to compile with VS2008 (PCbuild9
directory?)
* Fork msvccompiler and fix it for VS2008
* Fix Tools/msi

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1449
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Christian Heimes

Christian Heimes added the comment:

I've yet another idea for a tiny improvement. Instead of doing

   newfd = _socket.dup(socket_instance.fileno())

I prefer

   newfd = _socket.dup(socket_instance)

It removes some confusing magic and makes error checking on Windows
slightly easier.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1449] make msi work the vs 2005(MSVC8)

2007-11-15 Thread Martin v. Löwis

Martin v. Löwis added the comment:

One issue that also needs discussion is the structure of the build
directory. It could temporarily be PCbuild9, but in the long run, it
should replace PCbuild. Apart from that, the issue is whether there
should be a flat structure as it is currently in PCbuild, or a nested
one as it is in PCbuild9; I think that flat is better than nested. Then
another issue is whether it should support building both AMD64 and x86
from the same source tree; I don't think that this is necessary. And so
on; this really needs to be discussed on python-dev.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1449
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1451] SSL patch for Python 3000

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks!  To be continued in issue 1378...

--
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1451
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1451] SSL patch for Python 3000

2007-11-15 Thread Bill Janssen

Bill Janssen added the comment:

OK, it's checked in.  Let's see what the Windows buildbots think :-).

Bill

On Nov 15, 2007 1:35 PM, Bill Janssen [EMAIL PROTECTED] wrote:

 Bill Janssen added the comment:

 I'll check it in this afternoon -- I've just got to figure out how to
 run the Python clean-up tool.  Then you can check in the socket3.diff
 patch, then I'll make sure the SSL module works with that version of
 sockets.

 Bill

 On 11/15/07, Guido van Rossum [EMAIL PROTECTED] wrote:
 

  Guido van Rossum added the comment:
 
  If you haven't checked this in by tomorrow morning, I'll submit issue
  1378 (socket3.diff) first, and you'll have to do a bunch of cleanup.
  Or, if you like, I can submit that now and you can do the cleanup this
  afternoon.  (Basically, we can dup() sockets on Windows now, so all the
  nonsense about keeping our own reference counts is no longer needed --
  makefile() just hangs on to a dup() of the socket. This restores the
  semantics we had in 1.5.2...
 
  __
  Tracker [EMAIL PROTECTED]
  http://bugs.python.org/issue1451
  __
 

 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1451
 __


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1451
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Hold on, socket3.diff breaks four unit tests:

test_ftplib test_poplib test_smtplib test_urllib2net

 newfd = _socket.dup(socket_instance)

But that doesn't allow fromfd to work. I found some real use cases for
fromfd where the fd is passed in through some other means:

http://www.google.com/codesearch?as_q=socket%5C.fromfdbtnG=Search+Codeas_lang=python

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446] Link to call me for free

2007-11-15 Thread Georg Brandl

Georg Brandl added the comment:

Shouldn't the account be closed?

--
nosy: +georg.brandl

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1446
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1433] marshal roundtripping for unicode

2007-11-15 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I think you have a wrong understanding of round-tripping. 

In Unicode it is really irrelevant if you're using a UCS2 surrogate pair
or a UCS4 representation to describe a code point. The length of the
Unicode representation may change, but the meaning won't, so you don't
lose any information.

--
nosy: +lemburg

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1433
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1134] Parsing a simple script eats all of your memory

2007-11-15 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Corrected in revision 59001, with a modified patch.

--
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1134
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1451] SSL patch for Python 3000

2007-11-15 Thread Bill Janssen

Bill Janssen added the comment:

Looks like the Python SVN cert did not get included in the patch, which 
is causing a failure.  I'll check that in.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1451
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1423] wave sunau aifc 16bit errors

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Crys, since you apparently have working sound on Windows, could you have
a look at this?  There's also an (unrelated) issue with sunau.py on
Py3k, it doesn't work (but the unittests aren't strong enough to
discover that :-).

--
assignee:  - tiran
nosy: +tiran
priority:  - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1423
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread roudkerk

roudkerk added the comment:

Currently on Windows set_error() make use of a large array which maps 
socket error numbers to error messages.

This patch (against socketmodule.c from Python 2.6) removes that 
array and just lets PyErr_SetExcFromWindowsErr() 
generate the message by using the Win32 function FormatMessage().

It is orthogonal from the other patches discussed here.

Added file: http://bugs.python.org/file8761/set_error.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__

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



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks!  roudkerk's patch is submitted as revision 59004.

BTW I need to go back to the drawing board for the rest of the socket
patch here.  Using dup() in makefile() doesn't work for the
ssl.SSLSocket class.  Maybe the explicit reference counting is the best
we can get.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1720390] Remove backslash escapes from tokenize.c.

2007-11-15 Thread Ron Adam

Ron Adam added the comment:

It looks like the disabling of \u and \U in raw strings is done.  Does
tokenize.py need to be fixed, to match?

While working on this I was able to clean up the string parsing parts of
tokenize.c, and have a separate patch with just that.

And an updated patch with both the cleaned up tokenize.c and the no
escapes in raw strings in case it is desired after all.

Added file: http://bugs.python.org/file8762/tokenize_cleanup_patch.diff

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1720390
_Index: Parser/tokenizer.c
===
--- Parser/tokenizer.c	(revision 58951)
+++ Parser/tokenizer.c	(working copy)
@@ -1254,23 +1254,17 @@
 	/* Identifier (most frequent token!) */
 	nonascii = 0;
 	if (is_potential_identifier_start(c)) {
-		/* Process r, u and ur */
-		switch (c) {
-		case 'r':
-		case 'R':
+		/* Process b, r and br */
+		if (c == 'b' || c == 'B') {
 			c = tok_nextc(tok);
 			if (c == '' || c == '\'')
 goto letter_quote;
-			break;
-		case 'b':
-		case 'B':
+		}
+		if (c == 'r' || c == 'R') {
 			c = tok_nextc(tok);
-			if (c == 'r' || c == 'R')
-c = tok_nextc(tok);
 			if (c == '' || c == '\'')
 goto letter_quote;
-			break;
-		}
+	}
 		while (is_potential_identifier_char(c)) {
 			if (c = 128)
 nonascii = 1;
@@ -1417,59 +1411,51 @@
 		*p_end = tok-cur;
 		return NUMBER;
 	}
-
+   
   letter_quote:
 	/* String */
 	if (c == '\'' || c == '') {
-		Py_ssize_t quote2 = tok-cur - tok-start + 1;
-		int quote = c;
-		int triple = 0;
-		int tripcount = 0;
-		for (;;) {
-			c = tok_nextc(tok);
-			if (c == '\n') {
-if (!triple) {
-	tok-done = E_EOLS;
-	tok_backup(tok, c);
-	return ERRORTOKEN;
-}
-tripcount = 0;
-tok-cont_line = 1; /* multiline string. */
-			}
-			else if (c == EOF) {
-if (triple)
-	tok-done = E_EOFS;
-else
-	tok-done = E_EOLS;
-tok-cur = tok-inp;
-return ERRORTOKEN;
-			}
-			else if (c == quote) {
-tripcount++;
-if (tok-cur - tok-start == quote2) {
-	c = tok_nextc(tok);
-	if (c == quote) {
-		triple = 1;
-		tripcount = 0;
-		continue;
-	}
-	tok_backup(tok, c);
-}
-if (!triple || tripcount == 3)
-	break;
-			}
-			else if (c == '\\') {
-tripcount = 0;
-c = tok_nextc(tok);
-if (c == EOF) {
-	tok-done = E_EOLS;
-	tok-cur = tok-inp;
-	return ERRORTOKEN;
-}
-			}
+ 		int quote = c;
+		int quote_size = 1; /* 1 or 3 */
+		int end_quote_size = 0;
+ 
+		/* Find the quote size and start of string */
+		c = tok_nextc(tok);
+		if (c == quote) {
+ 			c = tok_nextc(tok);
+			if (c == quote)
+quote_size = 3;
 			else
-tripcount = 0;
+end_quote_size = 1; /* empty string found */
 		}
+		if (c != quote)
+		tok_backup(tok, c);
+
+		/* Get rest of string */
+		while (end_quote_size != quote_size) {
+ 			c = tok_nextc(tok);
+  			if (c == EOF) {
+if (quote_size == 3)
+ 	tok-done = E_EOFS;
+ else
+ 	tok-done = E_EOLS;
+ tok-cur = tok-inp;
+ return ERRORTOKEN;
+ 			}
+ 			if (quote_size == 1  c == '\n') {
+ 			tok-done = E_EOLS;
+ 			tok-cur = tok-inp;
+ 			return ERRORTOKEN;
+ 			}
+ 			if (c == quote)
+ 			end_quote_size += 1;
+ 			else {
+ 			end_quote_size = 0;
+ 			if (c == '\\')
+ 			c = tok_nextc(tok);  /* skip escaped char */
+ 			}
+ 		}
+		
 		*p_start = tok-start;
 		*p_end = tok-cur;
 		return STRING;
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1720390] Remove backslash escapes from tokenize.c.

2007-11-15 Thread Ron Adam

Changes by Ron Adam:


Added file: http://bugs.python.org/file8763/no_raw_escapes_patch.diff

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1720390
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1720390] Remove backslash escapes from tokenize.c.

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't think tokenizer.py needs to be changed -- it never interpreted
backslashes in string literals anyway (not even in regular, non-raw
literals).

The tokenizer.c cleanup is submitted as revision 59007.

I still am not warming up towards the no-raw-escapes feature, so I'm
closing this as rejected.  Nevertheless, thanks for your efforts!

--
resolution:  - rejected
status: open - closed

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1720390
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1378] fromfd() and dup() for _socket on WIndows

2007-11-15 Thread Guido van Rossum

Guido van Rossum added the comment:

I've submitted socket2.diff plus small changes to ssl.py.
This seems the best I can do given that I don't think I can make dup()
work on ssl sockets.

--
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1378
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1736190] asyncore/asynchat patches

2007-11-15 Thread billiejoex

billiejoex added the comment:

The current implementation of asynchat.async_chat.initiate_send method
doesn't look at what is specified in ac_out_buffer_size attribute which
represents the buffer size of the outgoing data defaulting to a maximum
of 4096 bytes to send in a single socket.send() call.

Note that this only happens when sending the data by using a producer
through the use of the push_with_producer method.
This happens because while the older asynchat version used slicing for
buffering:

 num_sent = self.send(self.ac_out_buffer[:obs]) # obs == ac_out_buffer_size

...the newer version just calls self.send using the entire data as
argument without caring of what ac_out_buffer_size thinks about it:

 num_sent = self.send(first)

What is specified in ac_out_buffer_size when using a producer is just
ignored and the only way to have control over the outgoing data buffer
is to operate directly on the producer.

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1736190
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1631171] implement warnings module in C

2007-11-15 Thread Brett Cannon

Changes by Brett Cannon:


--
assignee: nnorwitz - brett.cannon

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1631171
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1444] utf_8_sig streamreader bug, patch, and test

2007-11-15 Thread James G. sack (jim)

James G. sack (jim) added the comment:

I found the errror in my previous patch. It lacked a self.decode=.. line 
in the StreamReader.decode elif branch. 

I attach a replacement patch diff-u.py26_utf8sig (apply to the 2.6 version 
of utf_8_sig.py. (If allowed, I will next remove the incorrect patch.)

This one passes test_codecs.py as well as my previously attached test 
module.

The resulting utf_8_sig.py may benefit from further refctoring, but I 
didn't want to do more than necessary to fix the immediate bug.

Regards,
..jim

Added file: http://bugs.python.org/file8764/diff-u.py26_utf8sig

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1444
__

diff-u.py26_utf8sig
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com