[tor-bugs] #8943 [Obfsproxy]: Use of __file__ incompatible with py2exe

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed May 22 21:49:42 UTC 2013


#8943: Use of __file__ incompatible with py2exe
-----------------------+----------------------------------------------------
 Reporter:  dcf        |          Owner:  asn
     Type:  defect     |         Status:  new
 Priority:  normal     |      Milestone:     
Component:  Obfsproxy  |        Version:     
 Keywords:             |         Parent:     
   Points:             |   Actualpoints:     
-----------------------+----------------------------------------------------
 Running a py2exe of obfsproxy:
 {{{
 $ /cygdrive/c/Python27/python.exe setup_py2exe.py py2exe
 $ ./py2exe_bundle/dist/obfsproxy.exe
 Traceback (most recent call last):
   File "obfsproxy", line 6, in <module>
 NameError: name '__file__' is not defined
 }}}
 It works before the change in [https://gitweb.torproject.org/pluggable-
 transports/obfsproxy.git/commitdiff/a66db465f2c8fb418fbab616de299b3c113b39b3
 a66db465]:
 {{{
 $ ./py2exe_bundle/dist/pyobfsproxy.exe
 usage: pyobfsproxy.exe [-h] [--log-file LOG_FILE]
                        [--log-min-severity {error,warning,info,debug}]
                        [--no-log] [--no-safe-logging]
                        {managed,obfs2,dummy,obfs3,b64} ...
 pyobfsproxy.exe: error: too few arguments
 }}}
 I don't know if this trick used in flashproxy will help:
 {{{
     if getattr(sys, "frozen", False):
         script_dir = os.path.dirname(sys.executable)
     else:
         script_dir = sys.path[0]
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8943>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list