[issue4225] unicode_literals doesn't work in exec

2008-10-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

The attached patch works, but can be simplified by using a stack variable:

Index: pythonrun.c
===
--- pythonrun.c (revision 66902)
+++ pythonrun.c (working copy)
@@ -1284,7 +1290,13 @@

 {
PyObject *ret = NULL;
mod_ty mod;
-   PyArena *arena = PyArena_New();
+   PyCompilerFlags localflags;
+   PyArena *arena;
+
+   if (flags == NULL)
+   flags = localflags;
+
+   arena = PyArena_New();
if (arena == NULL)
return NULL;

--
nosy: +amaury.forgeotdarc

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



[issue1982] Feature: extend strftime to accept milliseconds

2008-10-29 Thread Wang Chun

Wang Chun [EMAIL PROTECTED] added the comment:

Ruby recently added support of millisecond and nanosecond to strftime.

This is their changeset:

http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=18731

To use the extended strftime, one can do:

 Time.now.strftime('%Y-%m-%dT%H:%M:%S.%L%z')
.. 2008-10-29T17:46:03.895+0800

In the current implementation of Python, both datetime and time modules 
have strftime. Like in Ruby, the strftime in datetime module is a 
method. But the strftime in time module is a function, which takes time 
value to be formatted from argument, and which must be a 9-tuple 
returned by gmtime or localtime. No microsecond data in the tuple, 
unfortunately.

I think as the first step we can make datetime.datetime.strftime do 
microsecond. I prefer microsecond to milli- or micro- second because it 
is something from the the system.

The current Ruby implementation use %L or %3N for millisecond, %6N for 
microsecond, and %N or %9N for nanosecond. I am not sure where they came 
from. Hope there can be some widely accepted standard.

--
nosy: +wangchun

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



[issue4227] unicode_literals and print_function do not work together.

2008-10-29 Thread Wang Chun

New submission from Wang Chun [EMAIL PROTECTED]:

If from __future__ import unicode_literals, print_function, 
unicode_literals works, but not print_function;

If from __future__ import print_function, unicode_literals, 
print_function works, but not unicode_literals.

--
components: Interpreter Core
messages: 75314
nosy: wangchun
severity: normal
status: open
title: unicode_literals and print_function do not work together.
type: behavior
versions: Python 2.6

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



[issue4227] unicode_literals and print_function do not work together.

2008-10-29 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

The bug has been fixed a couple of days ago. The fix will be in the next
release of Python 2.6. Thanks.

--
nosy: +christian.heimes
resolution:  - out of date
status: open - closed

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



[issue1544339] _ctypes fails to build on Solaris x86 32-bit (Sun compiler)

2008-10-29 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

FWIW, ctypes builds on trunk and all its tests
pass with Sun Studio 12.  I suspect this issue
can be closed but will leave that for Thomas to
decide.

--
nosy: +skip.montanaro

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



[issue1544339] _ctypes fails to build on Solaris x86 32-bit (Sun compiler)

2008-10-29 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

Though I should note that ctypes 1.0.2 won't build with Sun Studio 12
on Python 2.4 without some patches for the __i386 macro in
ffitarget.h.  I added this check near the top of ffitarget.h:

#ifdef __i386
/* Sun Studio 12 */
#define __i386__
#endif

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



[issue1544339] _ctypes fails to build on Solaris x86 32-bit (Sun compiler)

2008-10-29 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

*argh* segfault running tests w/ Sun Studio 12 compiled version
of ctypes 1.0.2:

% python ctypes/test/runtests.py -v
sh: objdump: not found
find_library('c') - sh: objdump: not found
 None
find_library('m') - sh: objdump: not found
 None
test_anon (ctypes.test.test_anon.AnonTest) ... ok
test_anon_nonmember (ctypes.test.test_anon.AnonTest) ... ok
test_anon_nonseq (ctypes.test.test_anon.AnonTest) ... ok
test_nested (ctypes.test.test_anon.AnonTest) ... ok
test (ctypes.test.test_array_in_pointer.Test) ... ok
test_2 (ctypes.test.test_array_in_pointer.Test) ... ok
test_classcache (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_from_address (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_from_addressW (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_numeric_arrays (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_simple (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_byval
(ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ...
oktest_callbacks
(ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ...
Segmentation Fault

Beginning of backtrace:

#0  0xfeb50ad4 in ffi_closure_SYSV_inner ()
   from
/export/home/skipm/python-sunstudio/lib/python2.4/site-packages/_ctypes.so
#1  0xfeb50cca in ffi_closure_SYSV ()
   from
/export/home/skipm/python-sunstudio/lib/python2.4/site-packages/_ctypes.so
#2  0xfe9d141f in _testfunc_callback_i_if ()
   from
/export/home/skipm/python-sunstudio/lib/python2.4/site-packages/_ctypes_test.so
#3  0xfeb50c4f in ffi_call_SYSV ()
   from
/export/home/skipm/python-sunstudio/lib/python2.4/site-packages/_ctypes.so
#4  0xfeb50aa4 in ffi_call ()
   from
/export/home/skipm/python-sunstudio/lib/python2.4/site-packages/_ctypes.so
#5  0xfeb4b440 in _call_function_pointer ()
   from
/export/home/skipm/python-sunstudio/lib/python2.4/site-packages/_ctypes.so
#6  0xfeb4baa0 in _CallProc ()
   from
/export/home/skipm/python-sunstudio/lib/python2.4/site-packages/_ctypes.so
#7  0xfeb483ea in CFuncPtr_call ()
   from
/export/home/skipm/python-sunstudio/lib/python2.4/site-packages/_ctypes.so
#8  0xfeeb23ba in PyObject_Call ()
   from /export/home/skipm/python-sunstudio/lib/libpython2.4.so.1.0
#9  0xfef16c38 in do_call ()
   from /export/home/skipm/python-sunstudio/lib/libpython2.4.so.1.0

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



[issue4228] struct.pack('L', -1)

2008-10-29 Thread Armin Rigo

New submission from Armin Rigo [EMAIL PROTECTED]:

struct.pack('L', -1) raises a DeprecationWarning since Python 2.5, as it
should.  However, it also returns a different (and nonsensical) result
than Python = 2.4 used to: it returns '\x00\x00\x00\x00' instead of
'\xff\xff\xff\xff'.

This might lead the zipfile module of release25-maint (the version =
2.5.2) to produce buggy zip files.  The -1 value can come as the
header_offset field, which will then be packed as an all-0 string
instead of an all-ff string in the zip file headers.

Given the DeprecationWarning I would classify this as low priority. 
However, given that the stdlib module zipfile relies on this feature in
release25-maint, it should probably really be fixed.

--
messages: 75319
nosy: arigo
severity: normal
status: open
title: struct.pack('L', -1)
versions: Python 2.5, Python 2.5.3, Python 2.6, Python 2.7

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



[issue4228] struct.pack('L', -1)

2008-10-29 Thread Armin Rigo

Armin Rigo [EMAIL PROTECTED] added the comment:

Ah, I should also mention that a fix of zipfile for 2.5 to no longer use
the deprecated feature (and thus no longer cause DeprecationWarnings)
also sounds like a good idea, in addition to the fix to the struct module.

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



[issue4229] Can't Start Python

2008-10-29 Thread Clifford Burtown

New submission from Clifford Burtown [EMAIL PROTECTED]:

I just got Python, in order to do some game modding that required it.
However, I can't open Python files in my computer, neither can I edit
them with IDLE. I'm using Vista. Is this common?

--
messages: 75321
nosy: CliffB
severity: normal
status: open
title: Can't Start Python
versions: Python 2.6

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



[issue4230] __getattr__ can't be a descriptor

2008-10-29 Thread Armin Rigo

New submission from Armin Rigo [EMAIL PROTECTED]:

The attached example works in the __add__ and __getattribute__ cases on
CPython, but fails in the __getattr__ case.  All three cases work as the
semantics say they should on Jython, IronPython and PyPy.  It's
admittedly an obscure use case. 

There is no reason that __getattr__ should behave differently.  The
behavior of __add__ and __getattribute__ is the correct one, according
to the rule that special methods are bound (with __get__) before they
are called.

--
components: Interpreter Core
files: x.py
messages: 75322
nosy: arigo, cfbolz
priority: low
severity: normal
status: open
title: __getattr__ can't be a descriptor
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file11905/x.py

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



[issue1109963] bdist_wininst ignores build_lib from build command

2008-10-29 Thread Anthony Tuininga

Anthony Tuininga [EMAIL PROTECTED] added the comment:

This problem also occurs in the bdist_msi command.

--
versions: +Python 2.5, Python 2.6

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



[issue902061] pydoc insists upon producing file: URLs

2008-10-29 Thread René Liebscher

René Liebscher [EMAIL PROTECTED] added the comment:

I would like to see this change introducing a method of class HTMLDoc.

It has already some such methods as:

def namelink(self, name, *dicts):
def classlink(self, object, modname):
def modulelink(self, object):
def modpkglink(self, data):

So it would be logically to make it a method 
 
def filelink(self,url,path):
 Make a link to source file.
 return 'a href=file:%s%s/a' % (url, path)
 
and changing the creating of the filelink to
...
filelink = self.filelink(url, path)
 except TypeError:
filelink = '(built-in)'
...

This way one can easily subclass HTMLDoc for own purposes and define a
own filelink method.

--
nosy: +r.liebscher

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



[issue4229] Can't Start Python

2008-10-29 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

You need to install for all users, not just for me (the latter is
not supported on Vista), or alternatively install 2.5.2. This will be
fixed in 2.6.1.

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

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



[issue4231] print should be print(

2008-10-29 Thread David W. Lambert

New submission from David W. Lambert [EMAIL PROTECTED]:

http://docs.python.org/dev/3.0/reference/datamodel.html


 class Meta(type):
...def __getattribute__(*args):
...   print Metaclass getattribute invoked
xxx
... print Class getattribute invoked

perhaps there's a way to search all of the code examples in the new
documents to fix most of these occurrences instead of finding them
piecemeal?

print(re.compile(print *[^(]).search(code_examples(all_dev_docs)))

--
messages: 75326
nosy: LambertDW
severity: normal
status: open
title: print should be   print(

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



[issue4232] tempfile.gettempdir() availability not documented

2008-10-29 Thread Ville Skyttä

New submission from Ville Skyttä [EMAIL PROTECTED]:

The documentation for tempfile.gettempdir() at
http://docs.python.org/library/tempfile.html#module-tempfile does not
mention in which version the function was added.

Based on browsing older docs, looks like New in version 2.3. should be
added to its docs.

--
assignee: georg.brandl
components: Documentation
messages: 75327
nosy: georg.brandl, scop
severity: normal
status: open
title: tempfile.gettempdir() availability not documented
versions: Python 2.6

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



[issue4226] Should 2to3 know that file type is gone?

2008-10-29 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

I'm going to close this because inferring the correct type to replace
here is really beyond 2to3's capabilities. (I would recommend you look
at the io library for a replacement.)

--
nosy: +benjamin.peterson
resolution:  - rejected
status: open - closed

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



[issue4232] tempfile.gettempdir() availability not documented

2008-10-29 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Fixed in r67041.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

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



[issue4231] print should be print(

2008-10-29 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Fixed in r67043.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

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



[issue4226] Should 2to3 know that file type is gone? Python core crashes with associated files.

2008-10-29 Thread David W. Lambert

David W. Lambert [EMAIL PROTECTED] added the comment:

While trying to find a file replacement in the io library I managed to
get py3k to crash.  Please look at the file associated with the issue.

Thanks,
Dave.

--
title: Should 2to3 know that file type is gone? - Should 2to3 know that file 
type is gone?  Python core crashes with associated files.

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



[issue4225] unicode_literals doesn't work in exec

2008-10-29 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

This patch uses heap variables and tries to catch more places.

Added file: http://bugs.python.org/file11906/pass_flags.patch

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



[issue4226] Python core crashes with associated files.

2008-10-29 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


--
components: +Interpreter Core -2to3 (2.x to 3.0 conversion tool)
priority:  - critical
resolution: rejected - 
status: closed - open
title: Should 2to3 know that file type is gone?  Python core crashes with 
associated files. - Python core crashes with associated files.

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



[issue4225] unicode_literals doesn't work in exec

2008-10-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

The newer patch is good.

I found another use of PyAST_FromNode() with NULL flags, and which has 
the same problem:

import parser
s=parser.suite(
 from __future__ import unicode_literals; print type(''))
eval(s.compile())

But I don't know how to correct this: the CO_FUTURE_UNICODE_LITERALS 
flag is determined during the parse phase (in parser.suite), but this 
value is lost and not passed to s.compile().
Maybe PyST_Object could grow a st_flags attribute.

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



[issue3816] __newobj__ pickle feature is not documented

2008-10-29 Thread Alexandre Vassalotti

Alexandre Vassalotti [EMAIL PROTECTED] added the comment:

Could explain me how this feature could be used, other than for
providing the efficient and backward-compatible pickling mechanism for
new-style classes?

--
nosy: +alexandre.vassalotti

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



[issue3816] __newobj__ pickle feature is not documented

2008-10-29 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Alexandre Vassalotti wrote:
 Alexandre Vassalotti [EMAIL PROTECTED] added the comment:
 
 Could explain me how this feature could be used, other than for
 providing the efficient and backward-compatible pickling mechanism for
 new-style classes?

The feature makes it easy to write __reduce__ methods for subclasses of 
builtins. Take this example:

def __newobj__(cls, *args):
 return cls.__new__(cls, *args)

class mydict(dict):
 def __reduce__(self):
 state = (dict(self), self.__dict__)
 return (__newobj__, (self.__class__,), state)

Without the __reduce__ method the information in __dict__ and the class 
would be lost.

Christian

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



[issue3816] __newobj__ pickle feature is not documented

2008-10-29 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Christian Heimes wrote:
 Christian Heimes [EMAIL PROTECTED] added the comment:
 
 Alexandre Vassalotti wrote:
 Alexandre Vassalotti [EMAIL PROTECTED] added the comment:

 Could explain me how this feature could be used, other than for
 providing the efficient and backward-compatible pickling mechanism for
 new-style classes?
 
 The feature makes it easy to write __reduce__ methods for subclasses of 
 builtins. Take this example:
 
 def __newobj__(cls, *args):
  return cls.__new__(cls, *args)
 
 class mydict(dict):
  def __reduce__(self):
  state = (dict(self), self.__dict__)
  return (__newobj__, (self.__class__,), state)

Of course one has to provide a __setstate__ method, too.

 def __setstate__(self, state):
 dict.update(self, state[0])
 self.__dict__.update(state[1])

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



[issue4233] open(0, closefd=False) prints 3 warnings

2008-10-29 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc [EMAIL PROTECTED]:

This happens with a recent py3k build:

 x = open(0, closefd=False)
 del x
C:\dev\python\py3k\lib\io.py:1461: RuntimeWarning: Trying to close 
unclosable fd!
  self.buffer.close()
C:\dev\python\py3k\lib\io.py:389: RuntimeWarning: Trying to close 
unclosable fd!
  self.close()
__main__:1: RuntimeWarning: Trying to close unclosable fd!

Also, there are no unit test for closefd.

--
components: Interpreter Core
messages: 75337
nosy: amaury.forgeotdarc
priority: critical
severity: normal
status: open
title: open(0, closefd=False) prints 3 warnings
versions: Python 3.0

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



[issue3723] Py_NewInterpreter does not work

2008-10-29 Thread Graham Dumpleton

Graham Dumpleton [EMAIL PROTECTED] added the comment:

In conjunction with #4213, the attached subinterpreter.patch appears to 
fix issue for mod_wsgi.

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



[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-29 Thread Graham Dumpleton

Graham Dumpleton [EMAIL PROTECTED] added the comment:

In conjunction with #3723 and #4213, the attached atexit_modulestate.patch 
appears to fix issue for mod_wsgi.

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



[issue4234] bin missing from documentation

2008-10-29 Thread Glenn Linderman

New submission from Glenn Linderman [EMAIL PROTECTED]:

Py3.0 has

bin(x)
Convert an integer number to a binary string. The result is a valid
Python expression. If x is not a Python int object, it has to define an
__index__() method that returns an integer. 

Py2.6 doesn't document builtin bin.

--
assignee: georg.brandl
components: Documentation
messages: 75340
nosy: georg.brandl, v+python
severity: normal
status: open
title: bin missing from documentation
versions: Python 2.6

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



[issue4235] Crash when iImporting a builtin module crashes

2008-10-29 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc [EMAIL PROTECTED]:

Some object deallocator (file_dealloc) sometimes call PyErr_WarnEx.
This can happen on interpreter shutdown.
But this function may try to

--
messages: 75341
nosy: amaury.forgeotdarc
severity: normal
status: open
title: Crash when iImporting a builtin module crashes

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



[issue4235] Crash when iImporting a builtin module crashes

2008-10-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Sorry, bad issue creation

--
resolution:  - invalid
status: open - closed

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



[issue4234] bin missing from documentation

2008-10-29 Thread Glenn Linderman

Glenn Linderman [EMAIL PROTECTED] added the comment:

Perhaps there are other 3.0 builtins that were also missed, in the 2.6 docs?

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



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-29 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc [EMAIL PROTECTED]:

The following interactive session crashes the interpreter on shutdown:

 class C:
...   def __del__(self):
...  import warnings
...
 C()
__main__.C object at 0x00C29D58
 ^Z
Fatal Python error: Interpreter not initialized (version mismatch?)


This problem actually happens with the file object, which can call PyErr_WarnEx 
when it 
is deallocated and closed, see example in issue4226.
This Fatal message is new in 3.0. If I ignore it all seems correct, and the 
module is 
correctly imported.

--
messages: 75344
nosy: amaury.forgeotdarc
priority: release blocker
severity: normal
status: open
title: Crash when importing builtin module during interpreter shutdown
versions: Python 3.0

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



[issue4226] Python core crashes with associated files.

2008-10-29 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Closing in favor of #4236.

--
resolution:  - duplicate
status: open - closed
superseder:  - Crash when importing builtin module during interpreter shutdown

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



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-29 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc [EMAIL PROTECTED]:

 import io
 io.FileIO('foo', 'rt')
__main__:1: RuntimeWarning: Trying to close unclosable fd!
Traceback (most recent call last):
  File stdin, line 1, in module
ValueError: invalid mode: rt

The ValueError is expected, but the warning is not.
This happens on file deallocation: the file object is in an invalid 
state.

--
messages: 75346
nosy: amaury.forgeotdarc
severity: normal
status: open
title: io.FileIO('foo', 'rt') prints a RuntimeWarning
versions: Python 2.6, Python 3.0

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



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-29 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

I can reproduce the same output with CTRL+D on Linux.

$ python3.0
Python 3.0rc1+ (py3k:67029M, Oct 26 2008, 23:48:21)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type help, copyright, credits or license for more information.
 class C:
... def __del__(self):
... print(del)
... import warnings
...
[33876 refs]
 C()
__main__.C object at 0x7f4740a98d80
[33893 refs]
 exit()
[33900 refs]
del
Fatal Python error: Interpreter not initialized (version mismatch?)
Aborted

--
nosy: +christian.heimes

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



[issue4226] Python core crashes with associated files.

2008-10-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

There are actually three distinct issues here:
issue4233, issue4236, issue4237

Nice shot, David ;-)

--
nosy: +amaury.forgeotdarc

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



[issue4226] Python core crashes with associated files.

2008-10-29 Thread Christian Heimes

Changes by Christian Heimes [EMAIL PROTECTED]:


--
nosy: +christian.heimes
resolution: duplicate - 
status: closed - open

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



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-29 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Verified. The issue should be easy to fix.

I wonder why 'rt' is an invalid mode. Python 2.x supports 'rt'.

--
nosy: +christian.heimes
priority:  - normal

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



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-29 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

I propose to move self-closefd closer to the top of the function:

Index: Modules/_fileio.c
===
--- Modules/_fileio.c   (Revision 67040)
+++ Modules/_fileio.c   (Arbeitskopie)
@@ -181,6 +181,7 @@

self-readable = self-writable = 0;
self-seekable = -1;
+   self-closefd = closefd;
s = mode;
while (*s) {
switch (*s++) {
@@ -243,7 +244,6 @@

if (fd = 0) {
self-fd = fd;
-   self-closefd = closefd;
}
else {
self-closefd = 1;

--
keywords: +needs review, patch

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



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-29 Thread David W. Lambert

Changes by David W. Lambert [EMAIL PROTECTED]:


--
nosy: +LambertDW

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



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-29 Thread David W. Lambert

David W. Lambert [EMAIL PROTECTED] added the comment:

 print(io.read.__doc__)
...
The default mode is 'rt' (open for reading text).
...

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



[issue3816] __newobj__ pickle feature is not documented

2008-10-29 Thread Alexandre Vassalotti

Alexandre Vassalotti [EMAIL PROTECTED] added the comment:

 Without the __reduce__ method the information in __dict__ and 
 the class would be lost.

Are you sure about that?


Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
 class mydict(dict): pass
... 
 D = mydict({1:one,2:two})
 D.foo = 3
 import pickle
 E = pickle.loads(pickle.dumps(D))
 E.foo
3
 E
{1: 'one', 2: 'two'}
 type(E)
class '__main__.mydict'
 F = pickle.loads(pickle.dumps(D, 2))
 F.foo
3
 F
{1: 'one', 2: 'two'}
 type(F)
class '__main__.mydict'

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



[issue4238] BSD support for multiprocessing.cpu_count

2008-10-29 Thread Eric Gillespie

New submission from Eric Gillespie [EMAIL PROTECTED]:

Tested on NetBSD, but should work on any; sysctl goes back to 4.4BSD.

--
components: Library (Lib)
files: diff
messages: 75353
nosy: epg
severity: normal
status: open
title: BSD support for multiprocessing.cpu_count
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file11907/diff

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



[issue4239] Email example should use SMTP.quit() rather than SMTP.close()

2008-10-29 Thread Matt Johnston

New submission from Matt Johnston [EMAIL PROTECTED]:

The email module example has s.close(), while the smtplib docs say to
use .quit()

The latter is probably correct?

--
assignee: georg.brandl
components: Documentation
messages: 75354
nosy: georg.brandl, matt
severity: normal
status: open
title: Email example should use SMTP.quit() rather than SMTP.close()
type: behavior
versions: Python 2.6

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