[issue9319] segfault when searching modules with help()

2010-10-18 Thread Ron Adam
Ron Adam added the comment: The test in the patch isn't quite right. The following still fails. Python 3.2a3+ (py3k:85719, Oct 18 2010, 22:32:47) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import imp >>> imp.find_module('test/badsyntax_pep3

[issue9319] segfault when searching modules with help()

2010-08-04 Thread Ron Adam
Ron Adam added the comment: I added you to this Victor because it looks like what your doing to rewrite the imports to work with Unicode (issue:9425) overlaps this. See the test in the patch. Your rewrite may fix this as the segfault has to do with getting the file encoding. My apologies if

[issue9319] segfault when searching modules with help()

2010-08-04 Thread Stefan Krah
Stefan Krah added the comment: The diff which I posted was not really meant as the ultimate fix. It's a workaround. I think the real filename should be passed down to PyTokenizer_FromFile or PyTokenizer_FindEncoding. -- ___ Python tracker

[issue9319] segfault when searching modules with help()

2010-08-04 Thread Ron Adam
Ron Adam added the comment: This is by far the simplest fix for this. See patch file. This patch is what Stefan Krah suggested and I agree unless someone a lot more familiar with the import process can take a look at this and re-factor things so the filename is passed along with the file des

[issue9319] segfault when searching modules with help()

2010-07-29 Thread Ron Adam
Ron Adam added the comment: The error happens when Null is passed to strlen in (unicodeobject.c, line 860) Passing NULL to a string format function is probably in the category of don't do that. Stefans solution of checking for NULL before calling PyErr_Format looks to me to be correct. As h

[issue9319] segfault when searching modules with help()

2010-07-24 Thread Ron Adam
Ron Adam added the comment: Trying to look at this a bit further... The PyErr_Format function then calls PyUnicode_FromFormatV in Objects/unicodeobject.c to do the actual formating. It looks like there have been a number of issues of this type. Search the tracker for unicodeobject.c and PyUn

[issue9319] segfault when searching modules with help()

2010-07-21 Thread Stefan Krah
Stefan Krah added the comment: To be a little clearer: Since tok->filename is used as a flag in other places, I'm not sure where to set it without breaking other things. This is the location of the segfault and the following would "fix" it (using a placeholder for the name): Index: Parser/toke

[issue9319] segfault when searching modules with help()

2010-07-21 Thread R. David Murray
Changes by R. David Murray : -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue9319] segfault when searching modules with help()

2010-07-21 Thread Stefan Krah
Stefan Krah added the comment: Looks like tok->filename isn't set in PyTokenizer_FromFile: Index: Parser/tokenizer.c === --- Parser/tokenizer.c (revision 82984) +++ Parser/tokenizer.c (working copy) @@ -818,6 +818,7 @@ tok-

[issue9319] segfault when searching modules with help()

2010-07-20 Thread Ron Adam
New submission from Ron Adam : help('modules spam') causes segfault. When pydoc tries goes though the files it does the following in the ModuleScanner class. (minimal example) >>> for importer, modname, ispkg in pkgutil.walk_packages(): ... if modname == 'test.badsyntax_pep3120': ...