os.environ['HOMEDRIVE']+os.environ['HOMEPATH'].replace('\\','/')+'/'

Ugh, don’t do manual path concatenation! :)

import os
path = os.path.join(os.environ['HOMEDRIVE'], os.environ['HOMEPATH'])

Better yet, use expanduser

import os
path = os.path.expanduser("~")

That way it isn’t dependent on Windows.
​

On 26 November 2014 at 14:52, Crest Christopher <[email protected]>
wrote:

> Hi, the problem has be solved, thank you, no more error.
>
> What exactly was the problem, it was trying to write to the root drive ?
>
> Christopher
>
>   Eduardo Grana <[email protected]>
>  Wednesday, November 26, 2014 6:14 AM
> Hello Christopher,
>
> try replacing C: (__file__.split('\\')[0]) for you user's home path,
> maybe that way you can check if the problem is with writing permissions.
> where it says (uistates.py line 9)
>
> class UiStates():
>         filename = 'config.uvd'
>         path = __file__.split('\\')[0]+'/'
>
> change it to:
>
> class UiStates():
>         filename = 'config.uvd'
>         #path = __file__.split('\\')[0]+'/'
>         path =
> os.environ['HOMEDRIVE']+os.environ['HOMEPATH'].replace('\\','/')+'/'
>
> Cheers,
> Eduardo
>
>
>
>
> --
> Eduardo Graña
> www.eduardograna.com.ar
>  --
> 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/CACt6GrmH0txJWtJbPjk%2ByCQXhhuLZLtHqNRoPwVBmOtCaeD-SA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CACt6GrmH0txJWtJbPjk%2ByCQXhhuLZLtHqNRoPwVBmOtCaeD-SA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>   Crest Christopher <[email protected]>
>  Wednesday, November 26, 2014 12:47 AM
>  File A  code - [Link <http://pastebin.com/udHDfZNx#>]
> File B code - [Link <http://pastebin.com/nGmNAr86>]
>
> Here are the links to the source !
>
> Christopher
>    Justin Israel <[email protected]>
>  Sunday, November 23, 2014 2:06 PM
> Presumably the tool is trying to write out a data file to your C: drive,
> and does not have permission.
> Without the link to the source, I can't be sure, but is there an input for
> telling it where to store this file? Apparently your C: root is not a
> sufficient location.
>
> --
> 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/CAPGFgA2jjvMuy642OJ4%2BzgdsfisnWboSVEkRW0Hnk%3DEo%3D4Ho6Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2jjvMuy642OJ4%2BzgdsfisnWboSVEkRW0Hnk%3DEo%3D4Ho6Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>   Marcus Ottosson <[email protected]>
>  Sunday, November 23, 2014 12:40 PM
> Crest, I would love nothing more than to help you solve this problem, but
> you're not making it very easy.
>
> If you have a look at some of the other questions in this list, or on
> StackOverflow, you'll find that the best thing for you to do would be for
> you to share an isolated snippet of code with the problem. That way, I
> could more easily determine what may be causing this issue.
>
> Also, for the best possible answers, I would strongly suggest skimming
> this.
> http://www.catb.org/esr/faqs/smart-questions.html
>
>
>
>
> --
> *Marcus Ottosson*
> [email protected]
>  --
> 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/CAFRtmOCtA2TbONjDHKJEVtgCA-fxhrN4VLUCG9xUkXYYsmY7PQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCtA2TbONjDHKJEVtgCA-fxhrN4VLUCG9xUkXYYsmY7PQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>   Crest Christopher <[email protected]>
>  Sunday, November 23, 2014 11:53 AM
>  The script is available online "UV Deluxe", or do you prefer I post the
> code as well ?
>
> Clicking any one of the tabs within the tool causes this error;
>
> box is false
> # Error: 13
> # Traceback (most recent call last):
> #   File "<custom path>\UVDeluxe\uvdeluxe.py", line 230, in <lambda>
> #     ec=lambda *args:uis.setUiState())
> #   File "<custom path>\UVDeluxe\uistates.py", line 88, in setUiState
> #     UiStates.pickleDump(self)
> #   File "<custom path>\UVDeluxe\uistates.py", line 36, in pickleDump
> #     datafile = open(UiStates.path+UiStates.filename,'w')
> # IOError: [Errno 13] Permission denied: 'C:/config.uvd' #
>
> Christopher
>
>  --
> 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/5475E91E.9070709%40gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/5475E91E.9070709%40gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
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/CAFRtmOBJ%2Brkthz1%3Dk1pSZMCM%3D6nY_L3CB2Do9q8p2bXq396QZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to