The Little Guy Posted March 3, 2009 Share Posted March 3, 2009 In Python 2.5, I could just do this: root = "C:\Users\Administrator\Desktop\webserver\htdocs" and it would create a string, now in 3.0, I get an error: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-4: truncated \UXXXXXXXX escape What does that mean, and what do I do to fix it? Link to comment https://forums.phpfreaks.com/topic/147704-python-25-30/ Share on other sites More sharing options...
corbin Posted March 5, 2009 Share Posted March 5, 2009 Change all of the \ to \\. Link to comment https://forums.phpfreaks.com/topic/147704-python-25-30/#findComment-777742 Share on other sites More sharing options...
trq Posted March 6, 2009 Share Posted March 6, 2009 Better still use a raw string.... root = r'C:\Users\Administrator\Desktop\webserver\htdocs' Link to comment https://forums.phpfreaks.com/topic/147704-python-25-30/#findComment-777988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.