[issue26794] curframe can be None in pdb.py

2020-08-22 Thread Jacek Pliszka


Jacek Pliszka  added the comment:

Haven't seen it since then.

Stopped using 2.7 - using 3.6 in production and 3.7 in development now.

I believe it can be closed.

--

___
Python tracker 
<https://bugs.python.org/issue26794>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26794] curframe can be None in pdb.py

2016-04-18 Thread Jacek Pliszka

New submission from Jacek Pliszka:

In /usr/lib64/python2.7/pdb.py in
Pdb.default there is line:

globals = self.curframe.f_globals

curframe can be None so the line should be replaced by:

globals = getattr(self.curframe, "f_globals", None) if hasattr(self, 
'curframe') else None

or something should be done in different way in setup

--
components: Library (Lib)
messages: 263652
nosy: Jacek.Pliszka
priority: normal
severity: normal
status: open
title: curframe can be None in pdb.py
type: crash
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue26794>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12793] allow filters in os.walk

2011-08-31 Thread Jacek Pliszka

Jacek Pliszka  added the comment:

Looks like the proper way to do it is described in the manual:
http://docs.python.org/dev/library/os.html#os.walk

for root, dirs, files in os.walk('python/Lib/email'):
if 'CVS' in dirs:
dirs.remove('CVS')  # don't visit CVS directories
.

I checked that it is covered by unit tests in /test_os.py so it is safe to use 
and bug can blo closed as invalid.

--
resolution:  -> invalid

___
Python tracker 
<http://bugs.python.org/issue12793>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12793] allow filters in os.walk

2011-08-20 Thread Jacek Pliszka

Changes by Jacek Pliszka :


--
versions: +Python 2.7 -Python 3.2

___
Python tracker 
<http://bugs.python.org/issue12793>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12793] allow filters in os.walk

2011-08-20 Thread Jacek Pliszka

New submission from Jacek Pliszka :

I suggest a small change in os.walk module.  

Instead of:
def walk(top, topdown=True, onerror=None, followlinks=False):

I would like to have:
def walk(top, topdown=True, onerror=None, skipnames=lambda x : False, 
skipdirs=islink):

Implementation might be as follows:

< if isdir(join(top, name)):
---
> fullname=join(top, name)
> if skipnames(fullname):
> continue
> if isdir(fullname):

and:

< if followlinks or not islink(new_path):
< for x in walk(new_path, topdown, onerror, followlinks):
---
> if not skipdirs(new_path):
> for x in walk(new_path, topdown, onerror, skipnames, skipdirs):

This is a small change, breaks a bit 'followlinks' option but gives
much more flexibility as skipnames and skidirs can be any 
functions (including ones using regexp and similar).

--
components: Library (Lib)
files: os.diff
keywords: patch
messages: 142523
nosy: Jacek.Pliszka
priority: normal
severity: normal
status: open
title: allow filters in os.walk
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file22960/os.diff

___
Python tracker 
<http://bugs.python.org/issue12793>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com