This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients collinwinter, vstinner
Date 2008-08-14.15:44:54
SpamBayes Score 5.047948e-09
Marked as misclassified No
Message-id <1218728696.82.0.307782254741.issue3553@psf.upfronthosting.co.za>
In-reply-to
Content
I just installed Python 3.0b2 in /opt/py3k and tried 2to3 tool:

$ /opt/py3k/bin/2to3 -l
Available transformations for the -f/--fix option:
Traceback (most recent call last):
  File "/opt/py3k/bin/2to3", line 5, in <module>
    sys.exit(refactor.main("lib2to3/fixes"))
  File "/opt/py3k/lib/python3.0/lib2to3/refactor.py", line 69, in main
    for fixname in get_all_fix_names(fixer_dir):
  File "/opt/py3k/lib/python3.0/lib2to3/refactor.py", line 102, in 
get_all_fix_names
    names = os.listdir(fixer_dir)
OSError: [Errno 2] No such file or directory: 'lib2to3/fixes'

fixer_dir is the relative directory name "lib2to3/fixes", it should be 
an absolute directory. Example (ugly code copied from 
RefactoringTool.get_fixers()) to get the full path in refactor.py 
(main function):

    if not os.path.isabs(fixer_dir):
        fixer_pkg = fixer_dir.replace(os.path.sep, ".")
        if os.path.altsep:
            fixer_pkg = fixer_pkg.replace(os.path.altsep, ".")
        mod = __import__(fixer_pkg, {}, {}, ["*"])
        fixer_dir = os.path.dirname(mod.__file__)
History
Date User Action Args
2008-08-14 15:44:57vstinnersetrecipients: + vstinner, collinwinter
2008-08-14 15:44:56vstinnersetmessageid: <1218728696.82.0.307782254741.issue3553@psf.upfronthosting.co.za>
2008-08-14 15:44:55vstinnerlinkissue3553 messages
2008-08-14 15:44:54vstinnercreate