[issue17607] missed peephole optimization (unnecessary jump at end of function after yield)

2013-03-31 Thread Neal Norwitz

New submission from Neal Norwitz:

 def foo():
...   if x:
... yield None
... 
 dis.dis(foo)
  2   0 LOAD_GLOBAL  0 (x)
  3 POP_JUMP_IF_FALSE   14

  3   6 LOAD_CONST   0 (None)
  9 YIELD_VALUE 
 10 POP_TOP 
 11 JUMP_FORWARD 0 (to 14)
   14 LOAD_CONST   0 (None)
 17 RETURN_VALUE


The JUMP_FORWARD at 11 is not necessary and is not in place with a return in 
the code:

 def foo():
...  if x:
...   return None
... 
 dis.dis(foo)
  2   0 LOAD_GLOBAL  0 (x)
  3 POP_JUMP_IF_FALSE   10

  3   6 LOAD_CONST   0 (None)
  9 RETURN_VALUE
   10 LOAD_CONST   0 (None)
 13 RETURN_VALUE

--
components: Interpreter Core
messages: 185708
nosy: Neal.Norwitz
priority: normal
severity: normal
status: open
title: missed peephole optimization (unnecessary jump at end of function after 
yield)
type: performance
versions: Python 2.7

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



[issue17430] missed peephole optimization

2013-03-15 Thread Neal Norwitz

New submission from Neal Norwitz:

 def fo():
...   if a:
... if b:
...  if c:
...print
... 
 dis.dis(fo)
  2   0 LOAD_GLOBAL  0 (a)
  3 POP_JUMP_IF_FALSE   28

  3   6 LOAD_GLOBAL  1 (b)
  9 POP_JUMP_IF_FALSE   28

  4  12 LOAD_GLOBAL  2 (c)
 15 POP_JUMP_IF_FALSE   25

  5  18 PRINT_NEWLINE   
 19 JUMP_ABSOLUTE   25
 22 JUMP_ABSOLUTE   28
   25 JUMP_FORWARD 0 (to 28)
   28 LOAD_CONST   0 (None)
 31 RETURN_VALUE

The 2 JUMP_ABSOLUTEs should be optimized away since the code is equivalent to: 
if a and b and c: as in:

 dis.dis(fo)
  2   0 LOAD_GLOBAL  0 (a)
  3 POP_JUMP_IF_FALSE   22
  6 LOAD_GLOBAL  1 (b)
  9 POP_JUMP_IF_FALSE   22
 12 LOAD_GLOBAL  2 (c)
 15 POP_JUMP_IF_FALSE   22

  3  18 PRINT_NEWLINE   
 19 JUMP_FORWARD 0 (to 22)
   22 LOAD_CONST   0 (None)
 25 RETURN_VALUE

--
messages: 184245
nosy: Neal.Norwitz
priority: normal
severity: normal
status: open
title: missed peephole optimization
type: performance
versions: Python 2.7

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



[issue17335] FieldStorageClass is messed up

2013-03-01 Thread Neal Norwitz

New submission from Neal Norwitz:

This problem goes back to 2.6 at least.

In Lib/cgi.py

FieldStorageClass = None

def read_multi(self, environ, keep_blank_values, strict_parsing):
Internal: read a part that is itself multipart.
ib = self.innerboundary
if not valid_boundary(ib):
raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,)
self.list = []
if self.qs_on_post:
for key, value in urlparse.parse_qsl(self.qs_on_post,
self.keep_blank_values, self.strict_parsing):
self.list.append(MiniFieldStorage(key, value))
FieldStorageClass = None

The set of FieldStorageClass is to a local variable, so a no-op since it's 
never read.  The class attribute will always be None unless set outside this 
class (not sure if it is).  It looks like it should just be removed.

--
messages: 183308
nosy: Neal.Norwitz
priority: normal
severity: normal
status: open
title: FieldStorageClass is messed up
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue17068] peephole optimization for constant strings

2013-01-28 Thread Neal Norwitz

New submission from Neal Norwitz:

I was looking through code like this:

  foo = '%s%s%s' % ('https://', host, uri)

and realized this could be rewritten by the interpreter as:

  foo = 'https://%s%s' % (host, uri)

I tried to determine how much code this might affect, but it was pretty hard 
for me to come up with a decent regex to filter out all the false positives.  
There were too many hits to determine if this would be used often.

--
components: Interpreter Core
messages: 180885
nosy: nnorwitz
priority: normal
severity: normal
status: open
title: peephole optimization for constant strings
type: performance

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



[issue13764] Misc/build.sh is outdated... talks about svn

2012-01-13 Thread Neal Norwitz

Neal Norwitz nnorw...@gmail.com added the comment:

If this script isn't used any more, it should be removed.

On Fri, Jan 13, 2012 at 8:31 AM, Antoine Pitrou rep...@bugs.python.orgwrote:


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

 I think the script was used by the period regression test crontask that
 used to send emails to python-checkins. The crontask is offline and the
 script probably hasn't been used by anyone else, so we could indeed remove
 it.

 --
 components: +Demos and Tools -Build
 nosy: +brett.cannon, nnorwitz, pitrou
 priority: normal - low
 versions: +Python 2.7, Python 3.2, Python 3.3

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue13764
 ___


--

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



[issue10399] AST Optimization: inlining of function calls

2010-11-20 Thread Neal Norwitz

Neal Norwitz nnorw...@gmail.com added the comment:

There is some precedent for allowing minor differences in -O mode.
http://mail.python.org/pipermail/python-dev/2008-February/077193.html

I think we should push this to see how practical we can make it.
Dave, this is great work, I'm really interested to see you continue to
make progress and get something integrated.  Keep up the good work.

On Sat, Nov 20, 2010 at 1:11 PM, Dave Malcolm rep...@bugs.python.org wrote:

 Dave Malcolm dmalc...@redhat.com added the comment:

 Thanks for reading through this.

 There are a couple places you mention not doing the optimization when
 specific functions are used (e.g. dir, globals, locals), how exactly do you
 verify that, given those functions could be bound to any name?

 I don't: I'm only looking at explicit references to these global names:
   BUILTINS_THAT_READ_LOCALS = {'locals', 'vars', 'dir'}

 but I haven't attempted to track these at the object level, just at the name 
 level.

 This means that if someone is passing these around bound to a different name, 
 the results could be wrong: the optimizations that I'm doing are 
 synthesizing new local and global variables (in each case with a '__' 
 prefix), and sometimes eliminating local variables.

 However, it should work as expected for the simple and common case for code 
 like this:

  def foo():
      ...
      pprint(locals())
      ...

 since the reference to locals can be seen at the name level.

 But it won't work for something like this:

   def inlined_fn(a):
       print(a())

   def not_inlinable_for_some_reason(b):
       inlined_fn(b) # assume this callsite is inlined

   def some_other_fn_perhaps_in_another_module():
       hidden_ref_to_locals = locals
       not_inlinable_for_some_reason(hidden_ref_to_locals)

 in that (if inlining happens) the local printed will be named b, rather 
 than a.

 But this seems to me like a contrived example: how often in real code do 
 people pass around these builtins, rather than calling them directly?  I 
 myself use them for debugging, but I only ever call them directly.

 At a high level, what I'm interested in is providing additional benefits for 
 python 3 relative to python 2 (to encourage migration), and I picked 
 speed-ups.

 I think it's reasonable to provide some kind of optimized mode that is 
 allowed to take (limited) liberties with the language.

 Note that with other languages, people seem to accept some mild degradation 
 of debuggability in return for compiler optimizations.  I'd like to be able 
 to provide a faster python under similar kinds of tradeoffs.

 Currently, Python's optimized mode doesn't seem to do much (just compile away 
 assertions iirc).  Perhaps these optimizations could be associated with the 
 pre-existing optimizer flag; alternatively, perhaps a 3rd level could be 
 provided?

 This seems like a PEP-level request, but here's an outline of my thoughts 
 here:

 I'd like the highly-optimized mode to be permitted the following::
  - to create additional synthesized globals, with a __ prefix; modification 
 of these globals to lead to undefined behavior.
  - when querying locals under some circumstances (see below) for locals to 
 not be present, or for additional locals to be present::
     - when using inspect and reading/modifying a Frame's f_locals
     - in non-direct invocations of locals, globals and dir (however, 
 when called directly by name, they must work)
     - as per globals, synthesized locals to have a prefix, and modification 
 to lead to undefined behavior
  - a pony :)
  - more seriously, I'm planning to look next at inlining method calls (within 
 one module), and type inference, and I may come up with additional 
 requirements.

 I believe that the above covers all of the places where my patch is taking 
 liberties with existing Python semantics (modulo bugs): I'm still supporting 
 runtime rebinding of other names, and (I believe), preserving existing 
 behavior.  (please let me know if I'm missing something here!)

 There seems to be some precedent for this:
 http://docs.python.org/library/functions.html states:
 Note Because dir() is supplied primarily as a convenience for use at an
 interactive prompt, it tries to supply an interesting set of names more
 than it tries to supply a rigorously or consistently defined set of names,
 and its detailed behavior may change across releases. For example,
 metaclass attributes are not in the result list when the argument is a class.

 and for locals() it warns:
 Note The contents of this dictionary should not be modified; changes may not
 affect the values of local and free variables used by the interpreter.

 Does this sound sane? (obviously, actually approving this would be a matter 
 for the BDFL).

 Perhaps all synthesized vars could have a __internal__ prefix to signify 
 that they should be left alone.


 The other PEP-level request would be for the highly-optimized mode to be 
 permitted to take

[issue4970] test_os causes delayed failure on x86 gentoo buildbot: Unknown signal 32

2010-04-13 Thread Neal Norwitz

Neal Norwitz nnorw...@gmail.com added the comment:

Thanks for taking care of this guys.  Sorry, I got swamped with mail
and had to archive 3,000+ messages.  It looks like it's in good hands.

Let me know if there's anything you need.  I may not have access to
the box anymore, however, I can always contact Kurt.

--

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



[issue5023] Segfault in datetime.time.strftime(%z)

2009-01-27 Thread Neal Norwitz

Neal Norwitz nnorw...@gmail.com added the comment:

Can you debug this problem any further?  What is the C call stack?  Does
the problem occur if you build in debug mode (./configure
--with-pydebug)?  Does the problem occur with a different compiler (if
you have access to another one on the same box)?

--
nosy: +nnorwitz

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



[issue4597] EvalFrameEx fails to set 'why' for some exceptions

2008-12-08 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

The patch looks good.

These problems also apply to 2.5 I assume?  You might want to ping MvL
to let him know since he's about to cut that release.

--
keywords:  -needs review
nosy: +nnorwitz

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



[issue4582] type of __builtins__ changes if in main module or not

2008-12-07 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

This happens on 2.4 and 3.0, probably all versions:

When running this simple program (save to a file):

print(type(__builtins__))
__import__(__file__.split('/')[-1][:-3])

I get:
type 'module'
type 'dict'


I would expect the type to be consistent regardless of whether executing
the main module or from the imported module.  I haven't looked into why
this is happening or if it makes sense.  It was unexpected.

--
components: Interpreter Core
messages: 77252
nosy: nnorwitz
severity: normal
status: open
title: type of __builtins__ changes if in main module or not
type: behavior

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



[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2008-11-05 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Interesting approach.  I was surprised to see the change to the AST, but
I understand why you did it.  I think if the AST optimization approach
works out well, we will want to have some more general mechanism to
communicate these optimization (or other!) hints to the compiler.  It
would suck to have to modify the AST each time we wanted to add a new
optimization.  You and Tom might have better ideas for how best to
achieve that.

I'll make some comments that would need to be addressed, but you might
want to wait making any changes depending on what approach you decide to
take.

The most important missing piece is tests to show that the new code works.

There are various whitespace issues.  Both whitespace only changes that
should be avoided and indentation inconsistencies with the existing code
(or so it appears).  The latter could be the way I'm viewing the file or
existing problems with tabs.

In Python/optimize.c, you need to handle the case where the PyDict_New()
calls fail.  It looks like currently an undetected error can happen in
during construction.  And on destruction it will crash because the
objects will be NULL when calling Py_DECREF.

All calls like PyDict_SetItem(), PyInt_FromLong(), etc need to handle
errors.

I'll need to study the code a lot more to see how well it behaves. 
Tests would help a lot with that.

--
nosy: +nnorwitz

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



[issue3660] reference leaks in 3.0

2008-09-04 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

The only one that is probably an issue based on Antoine's info is:

test_unicode leaked [1, 1] references, sum=2

I've seen test_urllib2_localnet leak 3 before.  I don't know that it's
a real leak.  I'm pretty sure it is not a regression though.

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



[issue1210] imaplib does not run under Python 3

2008-08-26 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

This may not be a real release blocker, but I want to raise the
priority.  It is a regression and we should try to fix it, especially if
it's easy.

--
priority: normal - release blocker

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



[issue3657] pickle can pickle the wrong function

2008-08-25 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

It seems that if the tests are run in this order:

./python -E -tt ./Lib/test/regrtest.py -u all test_xmlrpc test_ctypes
test_json test_bsddb3 test_pickletools

The error will trigger consistently.  That is in 2.6 with a debug build
on a dual cpu box.  A debug build of 3.0 on the same machine did not
fail though I don't know if 3.0 has this problem. I was unable to prune
the list further.  The 3 tests (xmlrpc, ctypes and json) can be run in
any order prior to bsdb3 and then pickletools.

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



[issue3657] pickle can pickle the wrong function

2008-08-24 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

test_pickletools fails sporadically on at least two platforms I've seen.

http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4120/step-test/0
http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/1908/step-test/0

File
/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/pickletools.py,
line ?, in pickletools.__test__.disassembler_test
Failed example:
dis(pickle.dumps(random.random, 0))
Expected:
0: cGLOBAL 'random random'
   15: pPUT0
   18: .STOP
highest protocol among opcodes = 0
Got:
0: cGLOBAL 'bsddb.test.test_thread random'
   31: pPUT0
   34: .STOP
highest protocol among opcodes = 0
**
1 items had failures:
   1 of  25 in pickletools.__test__.disassembler_test

--
components: Interpreter Core
messages: 71830
nosy: nnorwitz
priority: release blocker
severity: normal
status: open
title: pickle can pickle the wrong function
versions: Python 2.6

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



[issue3627] apple security patches need to be forward ported to py3k

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Committed revision 66009.

--
assignee:  - nnorwitz
resolution:  - fixed
status: open - closed
type:  - security

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



[issue2744] Fix test_cProfile

2008-08-24 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
priority: critical - release blocker

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



[issue3660] reference leaks in 3.0

2008-08-24 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

Even after adding the current patch in http://bugs.python.org/issue3651
there are many reference leaks.  This bug can be a placeholder for all
the reference leaks returned from:  
  ./python ./Lib/test/regrtest.py -R 3:2 -uall,-bsddb 

The current list is:

test_unittest leaked [124, 124] references, sum=248
test_array leaked [110, 110] references, sum=220
test_audioop leaked [75, 75] references, sum=150
test_binascii leaked [4, 4] references, sum=8
test_binhex leaked [4, 4] references, sum=8
test_codecs leaked [3, 3] references, sum=6
test_ctypes leaked [9, 9] references, sum=18
test_dbm leaked [194, 194] references, sum=388
test_dbm_gnu leaked [2, 2] references, sum=4
test_fcntl leaked [2, 2] references, sum=4
test_file leaked [8, 8] references, sum=16
test_fileio leaked [1, 1] references, sum=2
test_memoryio leaked [3, 3] references, sum=6
test_minidom leaked [5, 5] references, sum=10
test_mmap leaked [307, 307] references, sum=614
test_ossaudiodev leaked [2, 2] references, sum=4
test_pickle leaked [130, 130] references, sum=260
test_pickletools leaked [503, 503] references, sum=1006
test_pyexpat leaked [1, 1] references, sum=2
test_re leaked [4, 4] references, sum=8
test_site leaked [88, 88] references, sum=176
test_socket leaked [13, 13] references, sum=26
test_sqlite leaked [17, 17] references, sum=34
test_ssl leaked [82, 82] references, sum=164
test_struct leaked [5, 5] references, sum=10
test_unicode leaked [2, 2] references, sum=4
test_urllib2_localnet leaked [3, 3] references, sum=6
test_xmlrpc leaked [18, 18] references, sum=36
test_xmlrpc_net leaked [1, 1] references, sum=2
test_zlib leaked [10, 10] references, sum=20

--
components: Interpreter Core
messages: 71851
nosy: nnorwitz
priority: release blocker
severity: normal
status: open
title: reference leaks in 3.0
versions: Python 3.0

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



[issue3610] Fix gdbinit for Python 3.0

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

I fixed some problems in r66016.  This patch seems like it has other
things which might be useful, so I'll keep it open until it's handled.

--
nosy: +nnorwitz

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



[issue3651] eval() leaks 1 reference every time

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Another PyBuffer_Release(pin); looks necessary at @@ -805,6 +807,7 @@.

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



[issue3304] invalid call to PyMem_Free() in fileio_init()

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

In 3.0 the free is necessary, though see http://bugs.python.org/issue3662 .

--
nosy: +nnorwitz
status: open - closed

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



[issue3662] _fileio._FileIO segfaults

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Daniel, thanks for running the fuzzer!  It would be great if you could
keep running it and find any more problems before releasing 2.6 and 3.0.

I agree with Benjamin and Amaury.  PyArg_ParseTupleAndKeywords()
shouldn't update the pointer if it failed.  Given the test, it's
unlikely for this to create a problem in the future.  Either as a crash
or as a memory leak.

Committed revision 66018. (2.6)
Committed revision 66019. (3.0)

--
assignee:  - nnorwitz
components: +Interpreter Core
nosy: +nnorwitz
resolution:  - fixed
status: open - closed

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



[issue1375] hotshot IndexError when loading stats

2008-08-24 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
type: crash - behavior

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



[issue2456] Make sysmodule.c compatible with Bazaar

2008-08-24 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
type: crash - feature request

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



[issue1210] imaplib does not run under Python 3

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Is this still a problem?

--
nosy: +nnorwitz
type: crash - behavior

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



[issue1658] RuntimeError: dictionary changed size during iteration in Tkinter

2008-08-24 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
type: crash - behavior

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



[issue1840] Tools/i18n/msgfmt.py fixes for Python 3.0

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Is this still a problem?

--
nosy: +nnorwitz
type: crash - behavior

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



[issue2747] Documentation of new gobject types fails

2008-08-24 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
type: crash - behavior

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



[issue2562] Cannot use non-ascii letters in disutils if setuptools is used.

2008-08-24 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
type: crash - behavior

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



[issue1838] Ctypes C-level infinite recursion

2008-08-24 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
assignee:  - theller
components: +ctypes -Extension Modules
nosy: +theller

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



[issue3657] pickle can pickle the wrong function

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

The valgrind errors below are possibly related.

Conditional jump or move depends on uninitialised value(s)
   PyUnicodeUCS2_EncodeUTF8 (unicodeobject.c:2216)
   _PyUnicode_AsString (unicodeobject.c:1417)
   save (_pickle.c:930)
   Pickler_dump (_pickle.c:2292)

Conditional jump or move depends on uninitialised value(s)
   PyUnicodeUCS2_EncodeUTF8 (unicodeobject.c:2220)
   _PyUnicode_AsString (unicodeobject.c:1417)
   save (_pickle.c:930)
   Pickler_dump (_pickle.c:2292)

Conditional jump or move depends on uninitialised value(s)
   PyUnicodeUCS2_EncodeUTF8 (unicodeobject.c:2227)
   _PyUnicode_AsString (unicodeobject.c:1417)
   save (_pickle.c:930)
   Pickler_dump (_pickle.c:2292)

Conditional jump or move depends on uninitialised value(s)
   PyUnicodeUCS2_EncodeUTF8 (unicodeobject.c:2229)
   _PyUnicode_AsString (unicodeobject.c:1417)
   save (_pickle.c:930)
   Pickler_dump (_pickle.c:2292)

Conditional jump or move depends on uninitialised value(s)
   PyUnicodeUCS2_EncodeUTF8 (unicodeobject.c:2233)
   _PyUnicode_AsString (unicodeobject.c:1417)
   save (_pickle.c:930)
   Pickler_dump (_pickle.c:2292)

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



[issue3651] eval() leaks 1 reference every time

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Also there should be a Misc/NEWS entry added. Also check the doc to see
it needs updating wrt ownership.

--
type:  - resource usage

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



[issue3657] pickle can pickle the wrong function

2008-08-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Indeed.  The problem was an incorrect conversion of str - unicode,
instead of converting to bytes.  On getting the buffer from unicode, it
tried to read data which was uninitialized.

Hmmm, this fix is for 3.0 only, but the problem is happening in 2.6. 
Leaving open.

Committed revision 66021.

--
assignee:  - nnorwitz

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



[issue3673] bsddb module leaks memory

2008-08-24 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

The attached patch against 2.6 fixes the memory leaks reported against
the bsddb module.  There are still (probably) reference leaks.

Jesus, it would be great if you can look at this before the release.

--
assignee: jcea
components: Extension Modules
files: bsddb.patch
keywords: patch, patch
messages: 71907
nosy: jcea, nnorwitz
priority: critical
severity: normal
status: open
title: bsddb module leaks memory
type: resource usage
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file11238/bsddb.patch

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



[issue3656] unicode encoding has lots of leaks of bytes

2008-08-23 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

Some of these leaks reported by valgrind are likely duplicates.  I don't
know how many individual cases of these leaks there are.

11,119 bytes in 14 blocks are possibly lost in loss record 86 of 119
realloc (vg_replace_malloc.c:429)
_PyBytes_Resize (bytesobject.c:3159)
multibytecodec_encode (multibytecodec.c:536)
MultibyteCodec_Encode (multibytecodec.c:588)
PyObject_Call (abstract.c:2181)
PyEval_CallObjectWithKeywords (ceval.c:3283)
PyCodec_Encode (codecs.c:354)
PyUnicodeUCS2_AsEncodedString (unicodeobject.c:1347)
unicode_encode (unicodeobject.c:6682)
PyEval_EvalFrameEx (ceval.c:3403)
PyEval_EvalFrameEx (ceval.c:3491)
PyEval_EvalCodeEx (ceval.c:2840)

11,882 bytes in 15 blocks are possibly lost in loss record 87 of 119
malloc (vg_replace_malloc.c:207)
PyBytes_FromStringAndSize (bytesobject.c:87)
PyUnicodeUCS2_EncodeUTF8 (unicodeobject.c:2250)
utf_8_encode (_codecsmodule.c:719)
PyEval_EvalFrameEx (ceval.c:3403)
PyEval_EvalFrameEx (ceval.c:3491)
PyEval_EvalFrameEx (ceval.c:3491)
PyEval_EvalCodeEx (ceval.c:2840)
function_call (funcobject.c:628)
PyObject_Call (abstract.c:2181)
PyEval_EvalFrameEx (ceval.c:3704)
PyEval_EvalCodeEx (ceval.c:2840)

271,937 bytes in 437 blocks are definitely lost in loss record 108 of 119
malloc (vg_replace_malloc.c:207)
PyBytes_FromStringAndSize (bytesobject.c:87)
PyEval_EvalFrameEx (ceval.c:3403)
PyEval_EvalCodeEx (ceval.c:2840)
PyEval_EvalFrameEx (ceval.c:3501)
PyEval_EvalFrameEx (ceval.c:3491)
PyEval_EvalCodeEx (ceval.c:2840)
function_call (funcobject.c:628)
PyObject_Call (abstract.c:2181)
PyEval_EvalFrameEx (ceval.c:3704)
PyEval_EvalCodeEx (ceval.c:2840)
function_call (funcobject.c:628)


331,647 bytes in 277 blocks are definitely lost in loss record 111 of 119
realloc (vg_replace_malloc.c:429)
_PyBytes_Resize (bytesobject.c:3159)
PyUnicodeUCS2_EncodeUTF8 (unicodeobject.c:2256)
_PyUnicodeUCS2_AsDefaultEncodedString (unicodeobject.c:1412)
source_as_string (bltinmodule.c:504)
builtin_exec (bltinmodule.c:788)
PyEval_EvalFrameEx (ceval.c:3403)
PyEval_EvalCodeEx (ceval.c:2840)
PyEval_EvalFrameEx (ceval.c:3501)
PyEval_EvalCodeEx (ceval.c:2840)
PyEval_EvalCode (ceval.c:519)
builtin_exec (bltinmodule.c:785)

274,686 bytes in 446 blocks are definitely lost in loss record 114 of 128
malloc (vg_replace_malloc.c:207)
PyBytes_FromStringAndSize (bytesobject.c:87)
PyEval_EvalFrameEx (ceval.c:3403)
PyEval_EvalCodeEx (ceval.c:2840)
PyEval_EvalFrameEx (ceval.c:3501)
PyEval_EvalFrameEx (ceval.c:3491)
PyEval_EvalCodeEx (ceval.c:2840)
function_call (funcobject.c:628)
PyObject_Call (abstract.c:2181)
PyEval_EvalFrameEx (ceval.c:3704)
PyEval_EvalCodeEx (ceval.c:2840)
function_call (funcobject.c:628)

734,178 bytes in 293 blocks are definitely lost in loss record 121 of 
realloc (vg_replace_malloc.c:429)
_PyBytes_Resize (bytesobject.c:3159)
PyUnicodeUCS2_EncodeUTF8 (unicodeobject.c:2256)
_PyUnicodeUCS2_AsDefaultEncodedString (unicodeobject.c:1412)
source_as_string (bltinmodule.c:504)
builtin_exec (bltinmodule.c:788)
PyEval_EvalFrameEx (ceval.c:3403)
PyEval_EvalCodeEx (ceval.c:2840)
PyEval_EvalFrameEx (ceval.c:3501)
PyEval_EvalCodeEx (ceval.c:2840)
PyEval_EvalCode (ceval.c:519)
builtin_exec (bltinmodule.c:785)

--
components: Interpreter Core
messages: 71825
nosy: nnorwitz
priority: release blocker
severity: normal
status: open
title: unicode encoding has lots of leaks of bytes
type: resource usage
versions: Python 3.0

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



[issue3656] unicode encoding has lots of leaks of bytes

2008-08-23 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

There are also tons of reference leaks when running regrtest.py with -R.
 Even code as simple as this leaks:

 eval('1')
1
[40731 refs]
 eval('1')
1
[40732 refs]
 eval('1')
1
[40733 refs]
 eval('1')
1
[40734 refs]
 eval('1')
1
[40735 refs]

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



[issue3651] eval() leaks 1 reference every time

2008-08-23 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

This is a partial (or complete) duplicate of 3656.

--
nosy: +nnorwitz

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



[issue3656] unicode encoding has lots of leaks of bytes

2008-08-23 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

This is a partial (or complete) duplicate of 3651.

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



[issue3627] apple security patches need to be forward ported to py3k

2008-08-20 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

The trunk revision was 65335.

--
components: Interpreter Core
messages: 71608
nosy: nnorwitz
priority: release blocker
severity: normal
status: open
title: apple security patches need to be forward ported to py3k
versions: Python 3.0

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



[issue2620] Multiple buffer overflows in unicode processing

2008-07-27 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Committed revision 65261 for 2.5
Committed revision 65262 for 2.4.

--
status: open - closed

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



[issue1574217] isinstance swallows exceptions

2008-05-19 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

 I'd like to clarify the approach to fixing these types of problems.
 ...
 However, I like constricting it to AttributeError only as that would
 make it much less confusing. This might be something to bring up on
 python-dev.

I suspect that it might be on a case by case basis whether we want to
constrain more or less.  Bringing these cases up on python-dev should
lead to speedy decisions.

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



[issue2222] Memory leak in os.rename?

2008-05-07 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
priority: normal - critical

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



[issue2772] Add PendingDeprecationWarning for % formatting

2008-05-06 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Why not use the normal recursion check mechanism?  Specifically,

   if (Py_EnterRecursiveCall(unicode % ))
return NULL;
   // err = Warn();
   Py_LeaveRecursiveCall();

I don't see where the problem with threads comes in.  The GIL is held
and shouldn't be released during this call.  That may not be quite true
(it's conceivable the GIL is released when warning).  I'm not sure what
happens with the I/O system at this point, it's possible that releases
the GIL.  However, if GIL is released and re-acquired in PyWarn_WarnEx()
there are probably bigger issues than this patch that will need to be
addressed.  Note that since the warnings module is now implemented in C,
this should be easier to deal with.

Using the macros above in essence uses TLS, but through Python's
PyThreadState.

--
nosy: +nnorwitz

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



[issue1496032] test_float segfaults with SIGFPE on FreeBSD 6.0 / Alpha

2008-04-24 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

I think `uname -m` will be equal to alpha in this case.  There are
several uses of `uname -m` in configure.in.  You might need to add a
new section.  It might also be possible to clean up various special
cases to make a generic `uname -m` section.  I didn't look too closely
though.

-m is the machine type

BTW, -m works on Tru64.  I also tested on Ubuntu and it reported
x86_64, on Debian it reported sparc.  On OSX.4, it reported Power
Macintosh.

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



[issue2541] Unicode escape sequences not parsed in raw strings.

2008-04-15 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

What is the status of this bug?  AFAICT, the code is now correct.  Have
the doc changes been applied?  The resolution on this report should be
updated too.  It's currently rejected.

--
nosy: +nnorwitz

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



[issue2601] [regression] reading from a urllib2 file descriptor happens byte-at-a-time

2008-04-15 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Bumping the priority.  I'd like to see this fixed before the next
release.  What version(s) does this problem apply to: 2.5, 2.6, 3.0?

--
nosy: +nnorwitz
priority: critical - release blocker

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



[issue2601] [regression] reading from a urllib2 file descriptor happens byte-at-a-time

2008-04-15 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

So if the fix was applied to 2.5 branch and 2.6 (3.0 should have
picked up from 2.6 automatically), can we close this bug?

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



[issue2611] Extend buildbot web interface to allow for forced tests to be run on a slave in verbose mode.

2008-04-14 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

  I think this will be fairly difficult to set up. If the clean buildstep
  had been executed, you would have to rerun configure and compile before
  you can run any tests.

We could re-order and do clean first.  That would leave all the build
artifacts in tact after a build which would be nice for some
debugging.

  Also, how would you communicate what specific test you want to run?

I agree here.  My guess is it would be pretty hard to modify the
buildbot to support this.  I don't have bandwidth to help.  It would
be nice to have, but probably not a high priority.

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



[issue2235] __eq__ / __hash__ check doesn't take inheritance into account

2008-04-14 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
assignee: amaury.forgeotdarc - gvanrossum

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



[issue2550] SO_REUSEADDR doesn't have the same semantics on Windows as on Unix

2008-04-06 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Trent, go ahead and try this out.  We should definitely be moving in
this direction.  So I'd rather fix the problem than keep suffering with
the current problems of not being able to run the test suite
concurrently.  I think bind_port might be documented, so you should
update the docs if so.  Also, please add a Misc/NEWS entry.

--
nosy: +nnorwitz
resolution:  - accepted

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



[issue1179] [CVE-2007-4965] Integer overflow in imageop module

2008-04-04 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

I think this was a module that I skipped.  I think Anthony might have
had a patch, but if we have a fix, I'm not sure it matters.  We need to
fix this for 2.5.3, upping the priority.

--
nosy: +anthonybaxter
priority: high - release blocker

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



[issue2515] Segfault while operating on closed sqlite3 cursor.

2008-04-04 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Gerhard, could you take a look?

--
assignee:  - ghaering
nosy: +ghaering, nnorwitz

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



[issue2515] Segfault while operating on closed sqlite3 cursor.

2008-04-04 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
priority:  - release blocker

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



[issue2526] str.format() :n format does not appear to work

2008-04-04 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Eric, could you take a look?

--
assignee:  - eric.smith
nosy: +eric.smith, nnorwitz
priority:  - high

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



[issue2546] Python-2.5.2: crash in visit_decref () at Modules/gcmodule.c:270

2008-04-04 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

I'm setting the priority to release blocker for now.  George, please
provide a way for us to reproduce with a stock python (ie, no third
party extensions).  Thanks.

--
nosy: +nnorwitz
priority:  - release blocker

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



[issue2548] Undetected error in exception handling

2008-04-04 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Brett, didn't you have a similar problem you fixed a while ago?  I
assigned to you for more input, feel free to reset to nobody.

--
assignee:  - brett.cannon
nosy: +brett.cannon, nnorwitz
priority:  - release blocker

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



[issue2538] memoryview of bytes is not readonly

2008-04-04 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Travis, could you take a look?

--
assignee:  - teoliphant
nosy: +nnorwitz, teoliphant

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2538
__
___
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

2008-04-01 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

On Tue, Apr 1, 2008 at 6:14 AM, Brett Cannon [EMAIL PROTECTED] wrote:

  Brett Cannon [EMAIL PROTECTED] added the comment:

  Neal's issues are addressed in this patch. I also finally filled out
  warnings.h. The only thing that I didn't deal with is Neal's worry of
  exposing _PyWarnings_Init(). It is not explicitly exported anywhere as
  part of the API so I am not sure what he is worrying about.

I wasn't so worried about exposing it, I didn't like the name
pollution (we're talking about init_warnings, right?).  I know that we
have other modules that use init*, but those are broken too.  I'm not
sure we should fix those in 2.6, but 3.0 we should.

_
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



[issue1631171] implement warnings module in C

2008-03-31 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

I didn't realize this was waiting for me.  You should have just checked
it in, that would have gotten me to review faster. :-)

pythonrun.c:
 * Should PyModule_GetWarningsModule() return a valid pointer?
 * The code below crashes.  Need to XDECREF, not DECREF (or similar).
+PyObject *warnings_module = PyImport_ImportModule(warnings);
+if (!warnings_module)
+PyErr_Clear();
+Py_DECREF(warnings_module);

Python/_warnings.c:
 * Remove // XXX(nnorwitz): need to parse -W cmd line flags

Include/pythonrun.h
 * init_warnings has the wrong name (not prefixed with _Py).  I'm not
sure it should be exported at all.

test_support/frozen:  did you want the captured_std{out,err} change in
this patch?

Changes to Makefile.pre.in other than adding _warnings.o?

I think this is good enough if it's working.  How about checking it in
after 1) the alpha is released Wed and 2) fixing up the nits?

_
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



[issue1503] test_xmlrpc is still flakey

2008-03-28 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Ugh.  The manpage for accept on Ubuntu 6.10 says:


On  Linux,  the  new  socket returned by accept() does not inherit file
status flags such as O_NONBLOCK and O_ASYNC from the listening  socket.
This  behaviour  differs from the canonical BSD sockets implementation.
Portable programs should not rely on inheritance or non-inheritance  of
file  status  flags and always explicitly set all required flags on the
socket returned from accept().


http://msdn2.microsoft.com/en-us/library/aa450277.aspx says that Windows
(CE, but I assume all variants) are like BSD in that they inherit
attributes.

The newly created socket is the socket that will handle the actual
connection and has the same properties as socket s, including the
asynchronous events registered with the WSAEventSelect function.

I assume that means blocking behavior.

I checked in r61993 which should fix the immediate problem with
test_xmlrpc.  I wonder if we should change socket to do the same thing
for all platforms.

--
nosy: +nnorwitz

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



[issue2477] parser support for future import of unicode_strings

2008-03-28 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Christian checked this in a few days ago in r61953 and a few other
revisions.

--
resolution:  - accepted
status: open - closed

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



[issue2459] speedup loops with better bytecode

2008-03-26 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Antoine, I hope to look at this patch eventually.  Unfortunately, there
are too many build/test problems that need to be resolved before the
next release.  If you can help out with those, I will be able to review
this patch sooner.

--
nosy: +nnorwitz

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



[issue2477] parser support for future import of unicode_strings

2008-03-25 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

This is a patch that modifies the parser to allow getting the future
import flags into the AST.  There are 2 approaches that are embedded
within the patch.  Both approaches can be seen in Python/pythonrun.c.

1) update_flags_from_node() - this pulls the __future__ import out of
the parser nodes.  It is not complete, but should give an idea of how
this approach could be generalized.
2) Add APIS such as PyParser_ParseFileFlagsEx that returns the flags
from the parser

The first approach is somewhat fragile and kinda breaks encapsulation. 
It's nice that all the changes are internal and localized.

The second approach is probably a better long term solution, but adds
even more APIs where there are already too many.

--
components: Interpreter Core
files: uni-strs.diff
keywords: patch
messages: 64458
nosy: nnorwitz
priority: critical
severity: normal
status: open
title: parser support for future import of unicode_strings
versions: Python 2.6
Added file: http://bugs.python.org/file9844/uni-strs.diff

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



[issue2491] io.open() handles errors differently on different platforms

2008-03-25 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

The attached file has a snapshot of the python.org homepage that was
causing test_urllibnet to fail on some platforms (2 sparc, and ia64 at
least), but not other platforms.  This should be handled consistently.

I don't know if there are really errors in the attached web page or not.
 The problem occurs at byte offset 13259:

 data[13250:13270]
'r - Journ\xc3\xa9es Python'

I suppose that's invalid for ASCII, but valid UTF-8.

See r61921.  There is a problem that the API for fdopen doesn't accept
errors, encoding, etc. so it's problematic to handle this condition.

--
components: Library (Lib)
files: py-org.html
messages: 64540
nosy: nnorwitz
priority: critical
severity: normal
status: open
title: io.open() handles errors differently on different platforms
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file9864/py-org.html

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



[issue2470] Need fixer for dl (removed) - ctypes module

2008-03-24 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

r61837 removed the dl module.  It needs a 2to3 fixer written to use ctypes.

--
assignee: collinwinter
components: 2to3 (2.x to 3.0 conversion tool)
messages: 64394
nosy: collinwinter, nnorwitz
priority: critical
severity: normal
status: open
title: Need fixer for dl (removed) - ctypes module

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



[issue1068881] TclError not a subclass of StandardError

2008-03-20 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

StandardError has been removed from Python 3.0.  It's use is deprecated.
 Instead of catching StandardError, do:

  try:
# ...
  except Exception:
# ...

--
assignee: loewis - nnorwitz
nosy: +nnorwitz
resolution:  - out of date
status: open - closed

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



[issue2183] optimize list comprehensions

2008-03-19 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Ya, I'll get around to it...hopefully soon.  But if someone wants to
do it for me, I won't complain. :-)

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



[issue2400] from .foo import * should work

2008-03-18 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

Explicit relative imports using from .foo import * should work.

http://mail.python.org/pipermail/python-3000/2008-March/012564.html

--
components: Interpreter Core
messages: 63942
nosy: nnorwitz
priority: critical
severity: normal
status: open
title: from .foo import * should work
versions: Python 2.6

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



[issue2409] regrtest should not just skip imports that fail

2008-03-18 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

Guido mentioned this in python-3000-checkins.  I agree the problem
should be fixed.


I think the automatic skip on ImportError is harmful.

We should add a helper function to test_support so that you can write

foobar = test_support.import_optional('foobar')

and it will skip the test if foobar cannot be imported; all other
failing imports should cause the test to *fail*.

This should be an easy two-part task.


--
components: Tests
messages: 63992
nosy: nnorwitz
priority: high
severity: normal
status: open
title: regrtest should not just skip imports that fail
versions: Python 2.6

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



[issue2321] return more memory from unicode objects to system

2008-03-17 Thread Neal Norwitz

New submission from Neal Norwitz [EMAIL PROTECTED]:

This patch returns more memory to the system when doing:

   x = [unicode(i) for i in xrange(100)]
   del x

If the above code is done, the memory before and after is quite
different.  After this patch, the memory of the process as reported by
the system (like top/ps) should be approximately the same

--
components: Interpreter Core
files: uni.diff
keywords: patch, patch
messages: 63654
nosy: nnorwitz
severity: normal
status: open
title: return more memory from unicode objects to system
type: resource usage
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file9689/uni.diff

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



[issue2375] PYTHON3PATH environment variable to supersede PYTHONPATH for multi-Python environments

2008-03-17 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
assignee:  - nnorwitz
nosy: +nnorwitz
priority:  - urgent

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



[issue2321] return more memory from unicode objects to system

2008-03-17 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

After discussing this with MvL, I'll check this patch into trunk and
2.5.  Alec, if you find other issues, please create a new patch.

Committed revision 61458.
Committed revision 61485. (2.5)

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



[issue2321] return more memory from unicode objects to system

2008-03-17 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


--
assignee:  - nnorwitz
resolution:  - accepted
status: open - closed

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



[issue2321] return more memory from unicode objects to system

2008-03-17 Thread Neal Norwitz

Changes by Neal Norwitz [EMAIL PROTECTED]:


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



[issue2332] Renaming of attributes on functions need to be backported.

2008-03-17 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Committed revision 61492.

--
resolution:  - fixed
status: open - closed

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



[issue2291] Catching all exceptions with 'object'

2008-03-15 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

See PEP 352.  Currently this is slated for python 2.8.  Perhaps the
schedule should be sped up a bit in light the current release schedule.
 Brett, any comments?  We should add all the warnings from PEP 352 with
the -3 flag to 2.6.

--
nosy: +brett.cannon, nnorwitz
versions: +Python 2.6 -Python 2.5

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



[issue2185] code objects should conserve memory

2008-03-15 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Marshal is the wrong place for this sort of thing (the code object is
where it should be done).

I botched the analysis.  The case is common, but only for the empty
tuple which I forgot to ignore.  (None,) was a common case when I
measured it.  We should measure the actual memory savings before
anything is implemented.

To answer your question, the case were this happens is:

  def foo(self):  return self.self

--
resolution:  - rejected
status: open - closed

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



[issue2262] Helping the compiler avoid memory references in PyEval_EvalFrameEx

2008-03-09 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

I bet with just a little more work, you could get rid of t and stream. 
t is only used for a single set of opcodes (STORE_SLICE+n).  stream is
only used for the PRINT opcodes.  The code in print could be moved to a
function which might allow the compiler to do a better job.  I'll
benchmark this later on amd64 and amd x86 linux boxes.  Maybe mac ppc g4
if I'm adventurous. :-)

--
nosy: +nnorwitz

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



[issue2262] Helping the compiler avoid memory references in PyEval_EvalFrameEx

2008-03-09 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Can't next_instr and stack_pointer move inside the for loop too?

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



[issue2181] optimize out local variables at end of function

2008-02-27 Thread Neal Norwitz

Neal Norwitz added the comment:

  I suppose you are aware that performing this optimization in general
  would break a lot of existing code that uses inspect.getstack() or
  sys._getframe() to peek at the caller's local variables.  I know this

Yes, with this optimization the variable might never be set or when
the function exits, the value would be set to the previous value.

Note that the current optimization only works just before a return and
only for local variables.  It doesn't generally optimize out
variables, although that would be a good next step.

  because it's one thing that Psyco doesn't do correctly, and one of the
  most common causes I'm aware of for a random existing program to break
  under Psyco.

How often does this cause problems?  Do you view this as psyco's
problem or broken user code?

I don't view this any different that a C compiler optimizing out
variables.  It can make debugging harder since the symbols no longer
exist.  In this case the variable name is not removed from the
co_varnames even if it is the only reference.  That would also be
nice, but left for another patch.  Since this will only be used with
-O and is currently limited, this seems reasonable to me.  But I would
like to know if others disagree.

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



[issue2181] optimize out local variables at end of function

2008-02-24 Thread Neal Norwitz

New submission from Neal Norwitz:

This patch optimizes code like:

   x = any_expression
   return x

to:
   return any_expression

Currently it only optimizes out the local variable if there is a return
because it can't determine if this is the last use of the variable or not.

This shouldn't change behaviour under normal circumstances, but would
change behaviour with a debugger.  Perhaps this optimization should only
be performed if -O is passed on the command line?

This optimization saves two trips around the eval loop (STORE_FAST and
LOAD_FAST) and 6 bytes in the byte code.

--
components: Interpreter Core
files: opt-out-local-var.patch
keywords: patch, patch
messages: 62957
nosy: nnorwitz
severity: normal
status: open
title: optimize out local variables at end of function
type: resource usage
Added file: http://bugs.python.org/file9544/opt-out-local-var.patch

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



[issue2181] optimize out local variables at end of function

2008-02-24 Thread Neal Norwitz

Neal Norwitz added the comment:

I forgot to mention that if another loop was added to PyCode_Optimize
that kept track of the # of times each local variable was
LOAD_FAST/STORE_FAST/DELETE_FAST and that the count was 2, we could
perform a similar optimization without requiring the return.

Bonus points for other cases like if it was the last use inside a list
comprehension or the variable is otherwise unaccessible.

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



[issue2183] optimize list comprehensions

2008-02-24 Thread Neal Norwitz

New submission from Neal Norwitz:

Optimize list comprehensions by using the list on the stack, rather than
storing in a (local/global) variable.  This reduces the size of the
stack by one pointer, reduces the bytecode size by 8, and reduces the
iterations in the eval loop by 2 + # of iterations to create the new
list.  It also eliminates internal variables in varnames.

List comps in module/class scope execute faster by avoiding more costly
dict lookups in globals.

For this source code:
def f(): return [x for x in s]

Byte code before change:
  1   0 BUILD_LIST   0
  3 DUP_TOP 
  4 STORE_FAST   0 (_[1])
  7 LOAD_GLOBAL  1 (s)
 10 GET_ITER
   11 FOR_ITER13 (to 27)
 14 STORE_FAST   1 (x)
 17 LOAD_FAST0 (_[1])
 20 LOAD_FAST1 (x)
 23 LIST_APPEND 
 24 JUMP_ABSOLUTE   11
   27 DELETE_FAST  0 (_[1])
 30 RETURN_VALUE

New byte code:
  1   0 BUILD_LIST   0
  3 LOAD_GLOBAL  0 (s)
  6 GET_ITER
7 FOR_ITER12 (to 22)
 10 STORE_FAST   0 (x)
 13 LOAD_FAST0 (x)
 16 LIST_APPEND  2
 19 JUMP_ABSOLUTE7
   22 RETURN_VALUE

DUP_TOP/STORE_FAST are eliminated before the loop.  One LOAD_FAST is
eliminated inside the loop.  LIST_APPEND is changed to reference the
value on the stack.  Is it a problem to change the opcode of LIST_APPEND?

This might make debugging harder.  I'm not sure how debuggers work with
list comps.

A similar optimization could probably be done to eliminate all uses of
the temporary variables (WITH_CLEANUP at least).

This patch still needs to update docs and the compiler package
implemented in Python.

--
components: Interpreter Core
files: list-comp-opt2.patch
keywords: patch, patch
messages: 62961
nosy: nnorwitz
severity: normal
status: open
title: optimize list comprehensions
type: resource usage
versions: Python 2.6
Added file: http://bugs.python.org/file9545/list-comp-opt2.patch

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



[issue2181] optimize out local variables at end of function

2008-02-24 Thread Neal Norwitz

Neal Norwitz added the comment:

I forgot to mention that if another loop was added to PyCode_Optimize
that kept track of the # of times each local variable was
LOAD_FAST/STORE_FAST/DELETE_FAST and that the count was 2, we could
perform a similar optimization without requiring the return.

Bonus points for other cases like if it was the last use inside a list
comprehension or the variable is otherwise unaccessible.

--
versions: +Python 2.6

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



[issue1394] simple patch, improving unreachable bytecode removing

2008-02-24 Thread Neal Norwitz

Neal Norwitz added the comment:

It would be great to see test cases with this change.  That would help
answer Alexander's question too.

--
nosy: +nnorwitz

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



[issue2185] code objects should conserve memory

2008-02-24 Thread Neal Norwitz

New submission from Neal Norwitz:

Various bits are often duplicated in code objects.  For example,
sometimes names and varnames are equal.  In this case, we don't need two
objects since they are both const.  This patch implements a trivial fix
for this case.  However, there are more cases.  We should profile where
the memory is being used and do simple/cheap consolidations where
possible.  Another example would be a 1-element tuple containing:
(None,) for consts.

Some (all?) of these sorts of optimizations should probably be done in
the code object itself.

--
files: marshal-mem.patch
keywords: patch, patch
messages: 62965
nosy: nnorwitz
severity: normal
status: open
title: code objects should conserve memory
type: resource usage
versions: Python 2.6
Added file: http://bugs.python.org/file9547/marshal-mem.patch

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



[issue2181] optimize out local variables at end of function

2008-02-24 Thread Neal Norwitz

Neal Norwitz added the comment:

Guido says to do it only with -O. 
http://mail.python.org/pipermail/python-dev/2008-February/077193.html

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



[issue1691070] Speed up PyArg_ParseTupleAndKeywords() and improve error msg

2008-02-24 Thread Neal Norwitz

Neal Norwitz added the comment:

Christian,

Could you clean this patch up?  Specifically:

 * Put everything into one patch
 * Eliminate unnecessary changes (changing variable name or whitespace)
 * Conform to the style in the file
 * Verify all the tests run with regrtest.py -u all  when built
--without-pydebug
 * Verify it runs faster

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



[issue2147] int operations no longer overflow

2008-02-19 Thread Neal Norwitz

New submission from Neal Norwitz:

Georg, I hope you don't mind me assigning this to you.  Feel free to
unassign.  A colleague pointed me to section 5.7 in the old ref doc:

http://docs.python.org/ref/shifting.html

It says that shifting operations lose data on overflow.  This info is
outdated based on PEP 237.  I suspect there may be other inaccuracies
related to int overflow.  So the purpose of this bug is to point out the
specific problem as well as to log that we need to find all invalid
references to overflow.

--
assignee: georg.brandl
components: Documentation
messages: 62586
nosy: georg.brandl, nnorwitz
severity: normal
status: open
title: int operations no longer overflow
versions: Python 2.5, Python 2.6, Python 3.0

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



[issue1953] Compact int and float freelists

2008-02-03 Thread Neal Norwitz

Neal Norwitz added the comment:

I think sys is appropriate for clearing the cache.  Lib/test/regrtest.py
still has a reference to gc rather than sys.

Why do the CompactFreeList APIs return an int that is always 0?  Seems
like they should return a real value or be void.

I'm not sure why you changed the functions to keep a block_list_length.
 I doubt this API would be requested very often.  Seems like it would be
better to just calculate when necessary (or perhaps not even add the APIs).

The only issue I have with the patch is the casting in the printf calls.
 These can lose information.  On Win64, long is 32-bits, but size_t is
64-bits.  See PY_FORMAT_SIZE_T in Include/pyport.h for how to handle this.

--
assignee: nnorwitz - tiran
resolution:  - accepted

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



[issue1750076] Python 2.5+ skips while statements in debuggers

2008-02-03 Thread Neal Norwitz

Neal Norwitz added the comment:

I was hoping you could get rid of my entire hack.  I didn't (still
don't) completely understand the intention of the code, so can't really
offer any more advice.  IMO, the patch is an improvement so you should
check it in.

--
assignee: nnorwitz - amaury.forgeotdarc
resolution:  - accepted

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



[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Neal Norwitz

Neal Norwitz added the comment:

I just added -Wstrict-overflow to the code in sysmodule.c
(sys_getframe) and tried with gcc 4.2.1.  It doesn't warn.  I wonder
if 4.3 is more picky or warns when it shouldn't?

Unless if I changed the code so it doesn't work:

typedef struct {int ref;} PyObject;
typedef struct { PyObject* f_back; } PyFrameObject;
int PyArg_ParseTuple(PyObject*, const char*, int*);

PyObject *
sys_getframe(PyFrameObject *f, PyObject *self, PyObject *args)
{
int depth = -1;

if (!PyArg_ParseTuple(args, |i:_getframe, depth))
return 0;

while (depth  0  f != 0) {
f = (PyFrameObject*)f-f_back;
--depth;
}
return (PyObject*)f;
}

Compiled with:
gcc-4.2.1-glibc-2.3.2/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc
-Wstrict-overflow -c xx.c

produced no warnings.  This is not a stock gcc 4.2.1, so that could
also be an issue.  Did I run it correctly.  Is there anything else I
need to do?  If you run the code above with gcc 4.3, does it produce a
warning?

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



[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Neal Norwitz

Neal Norwitz added the comment:

On Jan 27, 2008 6:45 PM, Ismail Donmez [EMAIL PROTECTED] wrote:

 Can you try with -Wstrict-overflow=3 , but yes I am using gcc 4.3 trunk.

I just tried with =1, =2, =3, and no =.  All the same result:  no warning.

Ismail, thanks for going through all this effort.  It's very helpful.

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



[issue1621] Do not assume signed integer overflow behavior

2008-01-25 Thread Neal Norwitz

Changes by Neal Norwitz:


--
nosy: +nnorwitz

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



[issue1303614] Bypassing __dict__ readonlyness

2008-01-23 Thread Neal Norwitz

Changes by Neal Norwitz:


--
nosy: +nnorwitz

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



[issue1303614] Bypassing __dict__ readonlyness

2008-01-23 Thread Neal Norwitz

Neal Norwitz added the comment:

I looked at Guido's latest deldict.diff patch--the one to
Objects/object.c only.  It seems good.  I can't convince myself either
way about the change to Objects/typeobject.c.  I can't think of a way
to cause a problem.  It seems safer to use Py_CLEAR in this case
though.

There are several other uses of _PyObject_GetDictPtr in
Objects/typeobject.c.  It was pretty much the same--I can't convince
myself either way.  Can Py_VISIT cause any Python code to execute that
might lead to a problem?  The other uses of _PyObject_GetDictPtr in
Objects/typeobject.c seemed safer.  Not a very useful review.

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



[issue1617] Rare exception in test_urllib2net

2008-01-23 Thread Neal Norwitz

Neal Norwitz added the comment:

This started happening consistently on my box and I was able to
reproduce it.  Revision 60233 should fix this problem.  I forwarded the
checkin to Greg.  Hopefully he can comment if there is a problem.  (Also
cc'd him on this bug report that I'm now closing.)

--
assignee:  - nnorwitz
nosy: +gregory.p.smith
resolution:  - fixed
status: open - closed

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



[issue1617] Rare exception in test_urllib2net

2007-12-13 Thread Neal Norwitz

Neal Norwitz added the comment:

This may happen every time on the MIPS buildbot.  Here is a recent run.

http://www.python.org/dev/buildbot/all/MIPS%20Debian%20trunk/builds/190/step-test/0

My guess is that there is some exception happening in C code and that
propagates back up to the error we see.  I could never find the root
cause when I tried to trace I down though.

--
nosy: +nnorwitz

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



[issue1705170] contextmanager eats StopIteration

2007-11-06 Thread Neal Norwitz

Neal Norwitz added the comment:

Nick, can you backport this and add a NEWS entry?  Thanks.

--
nosy: +nnorwitz

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



[issue1358] Compile error on OS X 10.5

2007-10-30 Thread Neal Norwitz

Neal Norwitz added the comment:

I don't have access to a 10.5 machine.  My guess is that the difference
is between configure not setting _XOPEN_SOURCE and/or
_XOPEN_SOURCE_EXTENDED and it being set in pyconfig.h.  At least those
are both defined on 10.4.  

This page talks about needing to include unistd.h, but doesn't give
enough info:
http://developer.apple.com/documentation/Darwin/Reference/Manpages/man2/setpgid.2.html

Hopefully someone else with access to 10.5 can confirm if this is the
case and we can resolve this.

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



  1   2   >