(f)
return str(data, 'raw-unicode-escape')
r"""
    >>> import io
    >>> read_unicodestringnl(io.BytesIO(b"abc\\uabcd\njunk")) == 'abc\uabcd'
    True
r"""
    >>> import io
    >>> read_unicodestringnl(io.BytesIO(b"abc\\uabcd\njunk")) == 'abc\uabcd'
    True
r >>> import io >>> read_unicodestringnl ( io . BytesIO ( b abc \\ uabcd \ njunk )) == abc \ uabcd True
def read_unicodestringnl(f):
    r"""
    >>> import io
    >>> read_unicodestringnl(io.BytesIO(b"abc\\uabcd\njunk")) == 'abc\uabcd'
    True
    """

    data = f.readline()
    if not data.endswith(b'\n'):
        raise ValueError("no newline found when trying to read "
                         "unicodestringnl")
    data = data[:-1]    # lose the newline
    return str(data, 'raw-unicode-escape')
def read_unicodestringnl ( f ) : data = f . readline ( ) if not data . endswith ( b'\n' ) : raise ValueError ( "no newline found when trying to read " "unicodestringnl" ) data = data [ : - 1 ] # lose the newline return str ( data , 'raw-unicode-escape' )