rez icon indicating copy to clipboard operation
rez copied to clipboard

integrate the entry for location mismatch error

Open yanshil opened this issue 3 years ago • 4 comments

os.path.realpath and pathlib.resolve() have different behavior in py3.7 and py3.7+

In python-3.7, os.path.realpath(path) return the drive location like l:\opt\rez\2.103.4\platform-windows But in python-3.8, it will return the unc path like \\\\studio-dfs\\studio\\...

I still came across with location mismatched error in some net use drive in py3.8 and py3.9 and found out that the location mismatch error in rez.package_repository was not fixed

   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\utils\data_utils.py", line 566, in func
     value = getattr(self.wrapped, key, None)
   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\utils\data_utils.py", line 260, in __get__
     result = self.func(instance)
   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\package_resources.py", line 374, in root
     return self._root()
   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\package_resources.py", line 511, in _root
     if self.base is None:
   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\utils\data_utils.py", line 566, in func
     value = getattr(self.wrapped, key, None)
   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\package_resources.py", line 535, in wrapped
     return self.parent
   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\utils\data_utils.py", line 260, in __get__
     result = self.func(instance)
   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rezplugins\package_repository\filesystem.py", line 285, in parent
     package = self._repository.get_resource(
   File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\package_repository.py", line 453, in get_resource
     handle = self.make_resource_handle(resource_key, **variables)
  File "l:\opt\rez\2.103.4\platform-windows\python-3.9\lib\site-packages\rez\package_repository.py", line 431, in make_resource_handle
    raise ResourceError("location mismatch - requested %r, repository "
rez.exceptions.ResourceError: location mismatch - requested 'l:\\apps\\studio\\prod', repository location is '\\\\studio-dfs\\studio\\apps\\studio\\prod'

yanshil avatar Jun 15 '22 07:06 yanshil

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: nerdvegas / name: allan johns (40823f93aa9dcbc4647186bf861c08534a916cc1)
  • :white_check_mark: login: yanshil / name: Yanshi Luo (a7e06a330a570376aec6758481c0b48afc1e02b9, 5785becedb3f17828d4945bb0ec2b7a01d35235d, 6b34c7aeeed9576ca45edef8d3f1217355d9005f)

Hello @yanshil , can you please sign the CLA? Signing the CLA means that you accept the terms of Rez' license. If you do this change on behalf of your employer, I suggest to talk to them before signing the CLA.

Thanks and let us know if you have questions.

/easycla

yanshil avatar Jul 02 '22 07:07 yanshil

@JeanChristopheMorinPerso CLA and DCO fixed. Thanks!

yanshil avatar Jul 02 '22 08:07 yanshil