Thanks for the info on the change!
Also, I'm not actually writing my own isdir method. Since the issue is
arising from using the new _isdir method from the nt module, I just switch
back to using the old genericpath.isdir method instead, which is what would
get used anyway if the _isdir import failed..
So I only added this to userSetup.py:
if sys.version_info >= (2, 7, 3):
os.path.isdir = genericpath.isdir
On Thursday, January 9, 2014 4:01:40 PM UTC-8, Jesse Kretschmer wrote:
>
> To be clear, this *is *a bad idea. I can't endorse ham-fistedly replacing
> anything in the core library.
>
> ...but I might be just fine for a small deployment. You will have to keep
> your eye out for strange errors that could arise from modification. As an
> aside, I decided to these this with a useSetup.py, and it worked. You will
> need to make sure that your monkey patch is executed before you load pymel.
>
> I did some more investigation into the problem. The spyderlib project
> worked around the issue by updating the path.py is in included in their
> package:
> https://code.google.com/p/spyderlib/source/detail?r=a9e776d6aa91
>
> That spyderlib link also points to the cpython changeset that caused the
> bug (http://hg.python.org/cpython/rev/f1509fc75435/).
>
> Perhaps Chad can get an updated path.py pushed into PyMel for a future
> release of Maya.
>
>
>
> On Thu, Jan 9, 2014 at 3:24 PM, Jesse Capper <[email protected]<javascript:>
> > wrote:
>
>> That's not a bad idea. We wouldn't have to roll out changes to each
>> machine in that case.
>>
>> Thanks.
>>
>>
>> On Thursday, January 9, 2014 2:54:41 PM UTC-8, Jesse Kretschmer wrote:
>>
>>> I've tested this in windows with Maya 2014 (2.7.3), and I am getting the
>>> error regardless of slashes.
>>>
>>> I just did a basic monkey patch, and it seems to work. If you create a
>>> userSetup.py in your PYTHONPATH, you should be able to overwrite the isdir
>>> function.
>>>
>>> Here's what I tested (http://pastebin.com/RU7eTk14).
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/29992df8-d7be-4c2d-9fd0-d607e14a9826%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.