kdwyer / apptrace

Automatically exported from code.google.com/p/apptrace
0 stars 0 forks source link

AttributeError: 'module' object has no attribute 'symlink' #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I get the following traceback when I try to run "apptracectl init .". Is 
apptrace only supported on unix based systems?

Traceback (most recent call last):
  File "c:\Python27\Scripts\apptracectl-script.py", line 9, in <module>
    load_entry_point('apptrace==0.2.3', 'console_scripts', 'apptracectl')()
  File "c:\Python27\lib\site-packages\apptrace-0.2.3-py2.7.egg\apptrace\scripts\apptracectl.py", line 132, in main
    initApptracePackage(app_root, [guppy])
  File "c:\Python27\lib\site-packages\apptrace-0.2.3-py2.7.egg\apptrace\scripts\apptracectl.py", line 92, in initApptracePackage
    ignore=True)
  File "c:\Python27\lib\site-packages\apptrace-0.2.3-py2.7.egg\apptrace\scripts\apptracectl.py", line 70, in copytree
    copytree(srcname, dstname, symlinks, exclude, ignore)
  File "c:\Python27\lib\site-packages\apptrace-0.2.3-py2.7.egg\apptrace\scripts\apptracectl.py", line 72, in copytree
    os.symlink(srcname, dstname)
AttributeError: 'module' object has no attribute 'symlink'

C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater>

Original issue reported on code.google.com by michael....@gmail.com on 7 Dec 2012 at 5:15

GoogleCodeExporter commented 8 years ago
FYI, this can be fixed by editing:
   C:\Python27\Lib\site-packages\apptrace-0.2.3-py2.7.egg\apptrace\scripts\apptracectl.py

and replacing the references to os.symlink(srcname, dstname) with:

                try:
                    os.symlink(srcname, dstname)
                except:
                    import ctypes
                    kdll = ctypes.windll.LoadLibrary("kernel32.dll")
                    kdll.CreateSymbolicLinkA(srcname, dstname, 0)

Original comment by michael....@gmail.com on 7 Dec 2012 at 5:27