Ticket #5675: trac_5675-address-launch.patch

File trac_5675-address-launch.patch, 862 bytes (added by timdumol, 3 years ago)

This sets the hostname to localhost if interface="" when launching the page

  • sagenb/notebook/run_notebook.py

    #5675 Auto browser open of notebook does not open to a valid url when interface=""
    
    diff -r ffb573e10b59 sagenb/notebook/run_notebook.py
    a b  
    171171                start_path = "'/?startup_token=%s' % startup_token" 
    172172            else: 
    173173                start_path = "'/'" 
    174             open_page = "from sagenb.misc.misc import open_page; open_page('%s', %s, %s, %s)"%(interface, port, secure, start_path) 
     174            if interface: 
     175                hostname = interface 
     176            else: 
     177                hostname = 'localhost' 
     178            open_page = "from sagenb.misc.misc import open_page; open_page('%s', %s, %s, %s)"%(hostname, port, secure, start_path) 
    175179        else: 
    176180            open_page = '' 
    177181