#!/usr/bin/env

from __future__ import print_function, unicode_literals

import sys


def safe_print(msg="", *args, **kwargs):
	"""Safely print strings containing unicode characters."""

	try:
		print(msg, *args, **kwargs)
	except:
		print(msg.encode(sys.stdout.encoding or 'utf8', errors='replace'), *args, **kwargs)

#!/usr/bin/env

from __future__ import print_function, unicode_literals

import sys


def safe_print(msg, *args, **kwargs):
	"""Safely print strings containing unicode characters."""

	try:
		print(msg, *args, **kwargs)
	except:
		print(msg.encode(sys.stdout.encoding or 'utf8', errors='replace'), *args, **kwargs)

--- 
+++ 
@@ -5,7 +5,7 @@
 import sys
 
 
-def safe_print(msg, *args, **kwargs):
+def safe_print(msg="", *args, **kwargs):
 	"""Safely print strings containing unicode characters."""
 
 	try:
Add default message to safe_print
