[Python-checkins] r82045 - python/branches/py3k/Lib/test/test_inspect.py

Jim Jewett jimjjewett at gmail.com
Thu Jun 17 15:59:33 CEST 2010


(1)  Do you mean a "bug" (as opposed to "but") in normcase?

(2)  It is probably worth clearing up what normcase should do if the
path isn't a string-like object.  Windows fails because None doesn't
support s.replace, but linux only works because the method is a no-op.
 And it is commented as a buggy no-op that *ought* to do something on
Mac OS X.

-jJ

On Thu, Jun 17, 2010 at 9:23 AM, r.david.murray
<python-checkins at python.org> wrote:
> Author: r.david.murray
> Date: Thu Jun 17 15:23:18 2010
> New Revision: 82045
>
> Log:
> Don't use os.normcase when the result we are expecting is None.
>
> This worked fine on linux but fails on Windows.  That may or may
> not be a but in normcase.
>
>
> Modified:
>   python/branches/py3k/Lib/test/test_inspect.py
>
> Modified: python/branches/py3k/Lib/test/test_inspect.py
> ==============================================================================
> --- python/branches/py3k/Lib/test/test_inspect.py       (original)
> +++ python/branches/py3k/Lib/test/test_inspect.py       Thu Jun 17 15:23:18 2010
> @@ -278,7 +278,7 @@
>         self.assertEqual(normcase(inspect.getsourcefile(git.abuse)), modfile)
>         fn = "_non_existing_filename_used_for_sourcefile_test.py"
>         co = compile("None", fn, "exec")
> -        self.assertEqual(normcase(inspect.getsourcefile(co)), None)
> +        self.assertEqual(inspect.getsourcefile(co), None)
>         linecache.cache[co.co_filename] = (1, None, "None", co.co_filename)
>         self.assertEqual(normcase(inspect.getsourcefile(co)), fn)
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>


More information about the Python-checkins mailing list