Open KelSolaar opened 4 years ago
So it seems like unsetenv
does work but not quite fully. I just lost 2 hours on that...
print(env.OCIO_ACTIVE_DISPLAYS)
unsetenv('OCIO_ACTIVE_DISPLAYS')
print(env.OCIO_ACTIVE_DISPLAYS)
Display 1:Display 2
Display 1:Display 2
But then in Maya:
import os
print os.environ['OCIO_ACTIVE_DISPLAYS']
# Error: OCIO_ACTIVE_DISPLAYS
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# File "[...]maya\bin\python27.zip\os.py", line 425, in __getitem__
# return self.data[key.upper()]
# KeyError: 'OCIO_ACTIVE_DISPLAYS' #
So it does unset the variable but it is partially cached somewhere still...
Looks like a bug to me. Let's ticket it up. Thx A
On Wed, Apr 15, 2020 at 3:11 PM Thomas Mansencal notifications@github.com wrote:
So it seems like unsetenv does work but not quite fully. I just lost 2 hours on that...
print(env.OCIO_ACTIVE_DISPLAYS) unsetenv('OCIO_ACTIVE_DISPLAYS') print(env.OCIO_ACTIVE_DISPLAYS)
Display 1:Display 2 Display 1:Display 2
But then in Maya:
import osprint os.environ['OCIO_ACTIVE_DISPLAYS']# Error: OCIO_ACTIVE_DISPLAYS# Traceback (most recent call last):# File "
", line 2, in # File "[...]maya\bin\python27.zip\os.py", line 425, in getitem# return self.data[key.upper()]# KeyError: 'OCIO_ACTIVE_DISPLAYS' # So it does unset the variable but it is partially cache somewhere still...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nerdvegas/rez/issues/875#issuecomment-613820012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOUSUJIRFGNGGHW3X4OEDRMU6YBANCNFSM4MIH2OBQ .
It really drove me nuts yesterday, went through the code (rez\utils\data_utils.py, rez\rex.py) which is really hard to follow with multiple nested data structure referencing each others. It would certainly benefit from documentation and a solid battery of unit tests. Thing that did not help is that I only found unsetenv
very late too, might be worth referencing directly around here: https://github.com/nerdvegas/rez/wiki/Package-Commands#variable-appending-and-prepending and not at the very end.
Hi,
I'm trying to delete a variable in an
env
attribute in mycommands
definition and I'm having a hard time. Any idea?Cheers,
Thomas