开发者

os.path.exist(path) error coming on starting any python program

开发者 https://www.devze.com 2023-03-02 04:40 出处:网络
I don\'t understand why I am getting a recursion depth error in the following lines source = zipfile.ZipFile( \"E:\\\\Zip Files\\\\80348.zip\' , \'r\' )

I don't understand why I am getting a recursion depth error in the following lines

source = zipfile.ZipFile( "E:\\Zip Files\\80348.zip' , 'r' )
source.extractall()

The file exists and I am able to open it. The Traceback I get is that

Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python26\lib\zipfile.py", line 940, in extractall
 self.extract(zipinfo, path, pwd)
File "C:\Python26\lib\zipfile.py", line 928, in extract
 return self._extract_member(member, path, pwd)
File "C:\Python26\lib\zipfile.py", line 961, in _extract_member
 if upperdirs and not os.path.exists(upperdirs):
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)

Could you tell what is going wrong here ......

EDIT :-

Hey , I just found out that this is not an error coming from zipfile.... I run any other python program I get the same error....

When I type python on the command line I get the error

Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.RuntimeError'> ignored 'import site' failed; use -v for traceback

I don't think the error is related to zipfile because I also saw this link.... import site error

I tried with -v and i got the following traceback

# installing zipimport hook
import zipimport # builtin
# installed zip开发者_如何学编程import hook
# C:\Python26\lib\site.pyc matches C:\Python26\lib\site.py
import site # precompiled from C:\Python26\lib\site.pyc
# C:\Python26\lib\os.pyc matches C:\Python26\lib\os.py
import os # precompiled from C:\Python26\lib\os.pyc
import errno # builtin
import nt # builtin
# C:\Python26\lib\ntpath.pyc matches C:\Python26\lib\ntpath.py
import ntpath # precompiled from C:\Python26\lib\ntpath.pyc
# C:\Python26\lib\stat.pyc matches C:\Python26\lib\stat.py
import stat # precompiled from C:\Python26\lib\stat.pyc
# C:\Python26\lib\genericpath.pyc matches C:\Python26\lib\genericpath.py
import genericpath # precompiled from C:\Python26\lib\genericpath.pyc
# C:\Python26\lib\warnings.pyc matches C:\Python26\lib\warnings.py
import warnings # precompiled from C:\Python26\lib\warnings.pyc
# C:\Python26\lib\linecache.pyc matches C:\Python26\lib\linecache.py
import linecache # precompiled from C:\Python26\lib\linecache.pyc
# C:\Python26\lib\types.pyc matches C:\Python26\lib\types.py
import types # precompiled from C:\Python26\lib\types.pyc
# C:\Python26\lib\UserDict.pyc matches C:\Python26\lib\UserDict.py
import UserDict # precompiled from C:\Python26\lib\UserDict.pyc
# C:\Python26\lib\_abcoll.pyc matches C:\Python26\lib\_abcoll.py
import _abcoll # precompiled from C:\Python26\lib\_abcoll.pyc
# C:\Python26\lib\abc.pyc matches C:\Python26\lib\abc.py
import abc # precompiled from C:\Python26\lib\abc.pyc
# C:\Python26\lib\copy_reg.pyc matches C:\Python26\lib\copy_reg.py
import copy_reg # precompiled from C:\Python26\lib\copy_reg.pyc
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__'
in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python
object' in <type 'exceptions.RuntimeError'> ignored
'import site' failed; traceback:
Traceback (most recent call last):
File "C:\Python26\Lib\site.py", line 513, in <module>
main()
File "C:\Python26\Lib\site.py", line 496, in main
known_paths = addsitepackages(known_paths)
File "C:\Python26\Lib\site.py", line 288, in addsitepackages
addsitedir(sitedir, known_paths)
File "C:\Python26\Lib\site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "C:\Python26\Lib\site.py", line 159, in addpackage
if not dircase in known_paths and os.path.exists(dir):
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)

What should I do ... Has anyone faced the same problem ?

0

精彩评论

暂无评论...
验证码 换一张
取 消