From 47bbd07733934ac1b4e7b47538a6fab990d5c210 Mon Sep 17 00:00:00 2001 From: adimitrova Date: Mon, 13 Mar 2017 10:29:52 +0100 Subject: [PATCH 1/3] updated decodestring --- notebook/services/contents/largefilemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/services/contents/largefilemanager.py b/notebook/services/contents/largefilemanager.py index 59328ef7e..8f0a8d9b1 100644 --- a/notebook/services/contents/largefilemanager.py +++ b/notebook/services/contents/largefilemanager.py @@ -57,7 +57,7 @@ class LargeFileManager(FileContentsManager): bcontent = content.encode('utf8') else: b64_bytes = content.encode('ascii') - bcontent = base64.decodestring(b64_bytes) + bcontent = base64.decodebytes(b64_bytes) except Exception as e: raise web.HTTPError( 400, u'Encoding error saving %s: %s' % (os_path, e) From 02cc1301660445ab10c0757ed51b51cf63fcdbd9 Mon Sep 17 00:00:00 2001 From: adimitrova Date: Mon, 13 Mar 2017 11:56:30 +0100 Subject: [PATCH 2/3] changed to pass python 2 tests too --- notebook/services/contents/largefilemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/services/contents/largefilemanager.py b/notebook/services/contents/largefilemanager.py index 8f0a8d9b1..10808ba83 100644 --- a/notebook/services/contents/largefilemanager.py +++ b/notebook/services/contents/largefilemanager.py @@ -57,7 +57,7 @@ class LargeFileManager(FileContentsManager): bcontent = content.encode('utf8') else: b64_bytes = content.encode('ascii') - bcontent = base64.decodebytes(b64_bytes) + bcontent = base64.b64decode(b64_bytes) except Exception as e: raise web.HTTPError( 400, u'Encoding error saving %s: %s' % (os_path, e) From 2fe8e46e2e1fd015e2cea1d15e5417bf5612ec01 Mon Sep 17 00:00:00 2001 From: Grant Nestor Date: Tue, 14 Mar 2017 08:50:53 -0700 Subject: [PATCH 3/3] Throw error if deprecated `decodestring` is used --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 622c74f59..7d3b74634 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,4 +8,4 @@ warningfilters=module |.* |DeprecationWarning |notebook.* ignore |.*schema.* |UserWarning |nbfor.* ignore |The 'warn' method is deprecated, use 'warning' instead | DeprecationWarning |notebook.* error |encodestring\(\) is a deprecated alias, use encodebytes\(\)| DeprecationWarning | notebook.* - + error |decodestring\(\) is a .*| DeprecationWarning | notebook.*