LumaPictures / pymel

Python in Maya Done Right
Other
490 stars 131 forks source link

HUGE os.environ bug in Maya 2022.3 Python3 #462

Closed guruBry closed 1 year ago

guruBry commented 1 year ago

Any call to os.environ() after pymel 1.2 is imported results in the environment variable getting completely messed up.

import os
os.environ.get('PATH')
# Expected: a single string value 
# Result: c:/Programs/software/win/core/maya/maya_2016.5/plug-ins/AT...

Now import pymel.core

import pymel.core
os.environ.get('PATH')
# Now you get a tuple which looks separated by spaces
#Result: ('Files/Cygwin/bin;C:/Windows/System32;C:/Program Files (x86)/NVIDIA '
 'Corporation/PhysX/Common;C:/Program Files/Git/cmd;C:/Program Files '
 '(x86)/QuickTime/QTSystem/;C:/Program '
  ...
)

Pymel does not convert to a tuple when using Python2 for Maya 2022.3.

guruBry commented 1 year ago

It's not pymel... it's the way python3 displays long strings now. Closing.