3

I am trying to install a win_unc library and I get the following error:

File "unc_credentials.py", line 36 """
Syntax error: (unicode error) 'unicodescape' codec can't decode bytes in position 340-341: truncated \uXXXX escape    

and this is the code snippet from the unc_credentials.py that is causing the issue:

def __init__(self, username=None, password=None):
    """
    Returns a new `UncCredentials` object. Both `username` and `password` are optional.
    If neither are provided, the new object will mean that credentials are unnecessary.
    `username` must be a string representing a Windows username (logon). Windows usernames
               may include a domain prefix (i.e. "domain\username"). If `username` cannot be
               construed as a valid Windows username, then this will raise an
               `InvalidUsernameError`.
               Note: UNC connections that require authentication will use the username of the
                     currently logged in Windows user unless specifically provided another
                     username.
               Note: Providing `None` and `""` (the empty string) have very different meanings.
                     Usernames cannot be empty.
    `password` must be a string representing a password.
               Note: Providing `None` and `''` (the empty string) have very different meanings.
               The empty string is a meaningful, legitimate password.

    If only the first positional argument is provided and it is already an instance of the
    `UncCredentials` class (either directly or by inheritance), this constructor will clone
    it and create a new `UncCredentials` object with the same properties.
    """    

the very last line with """" is line 36.

It looks like just a comment to me, but when I get rid of it I get another error no commands supplied

And it seems like there is an issue with the triple-double quotation marks on the last line, I may be wrong though.

I have tried playing around with different quotation marks and use 'r' in front of the strings, but I either get the same error or no commands supplied.

I would really appreciate any suggestions on how I can work around or fix this issue.

Irina Fortiss
  • 95
  • 1
  • 2
  • 6
  • Did you get any success invoking win_unc after pushing past the install? I'm getting a bunch of "TypeError: 'str' does not support the buffer interface" errors. Were you able to get past those? Or did you find an alternative to win_unc? – Ching Liu Nov 23 '20 at 18:26

2 Answers2

0

I no longer maintain this library. I cannot tell what's going on here but the only thing that comes to mind is the file was somehow corrupted during downloading or saving. If you open a HEX editor and inspect positions 340-341 as it suggests, you may find an odd non-ASCII character.

Please note that win_unc does not support systems using any language other than English.

Elliot Cameron
  • 5,235
  • 2
  • 27
  • 34
  • I got rid off the function comment, and installed the library with `build` and `install`, caused no issues, but I haven't actually used anything yet. – Irina Fortiss Jul 04 '17 at 17:14
  • This is unfortunate, I find win_unc immensely useful and cannot find a python 3 compatible api to replace it... – Ching Liu Nov 23 '20 at 18:27
0

I think, it is not necessary part of the script, just a comment. I've removed it and successful installed this module.

Alexey
  • 1