[ python-Bugs-1776160 ] Buffer overflow when listing deeply nested directory

2007-08-18 Thread SourceForge.net
Bugs item #1776160, was opened at 2007-08-17 06:24
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1776160&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bj�rn Lindqvist (sonderblade)
Assigned to: Nobody/Anonymous (nobody)
Summary: Buffer overflow when listing deeply nested directory

Initial Comment:
This code:

import os
import os.path
TARGET='C:/code/python/foo'
base = TARGET
for x in range(200):
subdirs = os.listdir(base)
base = os.path.join(base, subdirs[0])
print base

Produces a TypeError (buffer overflow) when run on a to deeply nested directory 
for windows to handle:

.. more output here..
C:code/python/foo\foo bar.png\foo bar.png\foo bar.png\foo bar.png\foo 
bar.png\foo bar.png\foo bar.png\foo bar.png\foo bar.png\foo bar.png\foo 
bar.png\foo bar.png\foo bar.p
ng\foo bar.png\foo bar.png\foo bar.png\foo bar.png\foo bar.png\foo bar.png\foo 
bar.png
Traceback (most recent call last):
  File "killdir.py", line 6, in 
subdirs = os.listdir(base)
TypeError: listdir() argument 1 must be (buffer overflow), not str


--

>Comment By: Skip Montanaro (montanaro)
Date: 2007-08-18 06:38

Message:
Logged In: YES 
user_id=44345
Originator: NO

Worked as expected for me on Mac OS X 10.4.10 running from
the trunk (you didn't mention what version you were using).
In ~/tmp/deep I created a maximally nested directory tree from the shell
like so:

cd /Users/skip/tmp/deep
for i in `range 1000` ; do
x=`printf %04d $i`
echo $x
mkdir $x
cd $x
done

where the range command is analogous to Python's range
builtin:

% range 20
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

The for loop barfed after making directory 0205.

In Python I then executed these statements:

import os.path
base = "/Users/skip/tmp/deep"
for x in range(210):
subdirs = os.listdir(base)
base = os.path.join(base, subdirs[0])
print base

This went until it got to dir 0200 where it raised an
OSError:

[Errno 63] File name too long:
'/Users/skip/tmp/deep//0001/.../0199/0200'

which stands to reason since base was 1025 characters long
at that point.  MAXPATHLEN is defined to be 1024 on my
system, so the OSError is to be expected.

Skip


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1776160&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1777057 ] memoryview('test') is causing a segfault

2007-08-18 Thread SourceForge.net
Bugs item #1777057, was opened at 2007-08-19 03:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1777057&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 3000
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Christian Heimes (tiran)
Assigned to: Nobody/Anonymous (nobody)
Summary: memoryview('test') is causing a segfault

Initial Comment:
./python -c "memoryview('test')"
Segmentation fault

I compiled Python 3.0 with 
$ ./configure --with-pydebug --enable-unicode=ucs4
and 
$ make EXTRA_CFLAGS="-DPy_REF_DEBUG -DPy_TRACE_REFS -DPy_DEBUG"
after a make clean; rm -rf build; svn up

I've used gdb to trace the segfault:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210415424 (LWP 14436)]
0x080f77a0 in PyErr_SetObject (exception=0x81962c0, value=0xb7cee3a8) at 
Python/errors.c:55
55  if (exception != NULL &&



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1777057&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1777057 ] memoryview('test') is causing a segfault

2007-08-18 Thread SourceForge.net
Bugs item #1777057, was opened at 2007-08-19 03:13
Message generated for change (Settings changed) made by tiran
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1777057&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 3000
Status: Open
Resolution: None
>Priority: 8
Private: No
Submitted By: Christian Heimes (tiran)
Assigned to: Nobody/Anonymous (nobody)
Summary: memoryview('test') is causing a segfault

Initial Comment:
./python -c "memoryview('test')"
Segmentation fault

I compiled Python 3.0 with 
$ ./configure --with-pydebug --enable-unicode=ucs4
and 
$ make EXTRA_CFLAGS="-DPy_REF_DEBUG -DPy_TRACE_REFS -DPy_DEBUG"
after a make clean; rm -rf build; svn up

I've used gdb to trace the segfault:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210415424 (LWP 14436)]
0x080f77a0 in PyErr_SetObject (exception=0x81962c0, value=0xb7cee3a8) at 
Python/errors.c:55
55  if (exception != NULL &&



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1777057&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1775388 ] Display CallTips for classes using metaclasses.

2007-08-18 Thread SourceForge.net
Bugs item #1775388, was opened at 2007-08-16 08:28
Message generated for change (Settings changed) made by kbk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1775388&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Noam Raphael (noamr)
>Assigned to: Kurt B. Kaiser (kbk)
Summary: Display CallTips for classes using metaclasses.

Initial Comment:
Hello,

Currently, if you write something like this:

class MyType(type):
pass

class MyClass(object):
__metaclass__ = MyType
def __init__(self, a):
pass

And write in the shell:

>>> MyClass(

a calltip won't be displayed.

To fix this, replace this line in CallTups.py:

if type(ob) in (types.ClassType, types.TypeType):

with this one:

if issubclass(type(ob), (types.ClassType, types.TypeType)):

and now it works.

Thanks,
Noam

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1775388&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1777057 ] memoryview('test') is causing a segfault

2007-08-18 Thread SourceForge.net
Bugs item #1777057, was opened at 2007-08-18 18:13
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1777057&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 3000
>Status: Closed
>Resolution: Fixed
Priority: 8
Private: No
Submitted By: Christian Heimes (tiran)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: memoryview('test') is causing a segfault

Initial Comment:
./python -c "memoryview('test')"
Segmentation fault

I compiled Python 3.0 with 
$ ./configure --with-pydebug --enable-unicode=ucs4
and 
$ make EXTRA_CFLAGS="-DPy_REF_DEBUG -DPy_TRACE_REFS -DPy_DEBUG"
after a make clean; rm -rf build; svn up

I've used gdb to trace the segfault:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210415424 (LWP 14436)]
0x080f77a0 in PyErr_SetObject (exception=0x81962c0, value=0xb7cee3a8) at 
Python/errors.c:55
55  if (exception != NULL &&



--

>Comment By: Neal Norwitz (nnorwitz)
Date: 2007-08-18 21:25

Message:
Logged In: YES 
user_id=33168
Originator: NO

Committed revision 57193.  This problem was due to not initializing the
new BufferError properly.  Travis mentioned this in his post to
python-3000.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1777057&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com