ERPNext Conference 2019* ERPNext.com Blog

NameError: name 'unicode' is not defined -- bench setup lets-encrypt


#1

Hi there,

I tried installing v12 from scratch, and when trying to do this:

sudo -H bench setup lets-encrypt site1.local --custom-domain mydomain.com

File “/home/ry/.bench/bench/config/nginx.py”, line 217, in get_sites_with_config
if isinstance(domain, str) or isinstance(domain, unicode):
NameError: name ‘unicode’ is not defined

Please advise, thanks!


#2

I am also getting the same error


#3

I solved this by editing nginx.py in .bench/bench/config and replacing the following line in 217

if isinstance(domain, str) or isinstance(domain, unicode):

with

if isinstance(domain, str) or isinstance(domain, bytes):


Bench setup nginx - No longer works! (v11)
No Longer able to setup Lets Encrypt on v11 (generates error)
#4

Hi Vinod,

Many thanks for posting this, I will try on my end.

If you don’t mind me asking, did you do a clean install? Did you use the easy install?

Thanks!


#5

easy install


#6

the error has nothing to do with the install kind i suppose though !! you may try replacing with ‘str’ too to see if it works …


#7

Thanks! I’ll have to wait for 7 more days as I made too many requests in let’s encrypt