jparise / python-reloader

Dependency-based Python Module Reloader
http://www.indelible.org/ink/python-reloading/
MIT License
135 stars 27 forks source link

TypeError when using monitor.py in Python 2.7.5 #17

Closed ming4883 closed 11 years ago

ming4883 commented 11 years ago

When using monitor.py in Python 2.7.5 (32.bit) on a Win8 64-bits mechine

A TypeError raised from line 73

Traceback (most recent call last):
  File "C:\Python27\Lib\threading.py", line 808, in __bootstrap_inner
    self.run()
  File "C:\Sandbox\exp_kinect\monitor.py", line 57, in run
    self._scan()
  File "C:\Sandbox\exp_kinect\monitor.py", line 73, in _scan
    stat = os.stat(filename)
TypeError: coercing to Unicode: need string or buffer, NoneType found

And I apply a hotfix by changing line 72-75 as follows

try: # line 72
  stat = os.stat(filename)
except OSError:
  continue
except:    # <- hotfix
  continue # <- hotfix