1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-02 03:52:55 -05:00

Fix unicode_escape (Fixes #2695)

This commit is contained in:
Philipp Hagemeister
2014-04-04 23:00:51 +02:00
parent 98b7cf1ace
commit 676eb3f2dd
2 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import calendar
import codecs
import contextlib
import ctypes
import datetime
@ -1263,9 +1264,11 @@ class PagedList(object):
def uppercase_escape(s):
unicode_escape = codecs.getdecoder('unicode_escape')
return re.sub(
r'\\U[0-9a-fA-F]{8}',
lambda m: m.group(0).decode('unicode-escape'), s)
lambda m: unicode_escape(m.group(0))[0],
s)
try:
struct.pack(u'!I', 0)