Issues import urllib2 into Grasshopper

grasshopper
(Dan Belcher) #1

Let’s take this to a separate topic.

Rhino 6 for Mac WIP build 6.15.19120.12036
Model unit change not working
(Dan Belcher) #2

@alain can you see if you can reproduce this behavior? Is this a regression from Rhino 5 for Mac?

(Alain Cormier) #4

@dan,
Importing the package is not a problem although getting what I want out of it is not immediately obvious.

I get make a request to a local server:

import urllib2
req = urllib2.Request('http://localhost:8000')
print dir(req)
response = urllib2.urlopen(req)
html = response.read()
print html

but if I try to access a remote site like developer.rhino3d.com I get:
the authentication or decryption has failed that I think has to do with all sites being now encrypted? Is that what the user is experiencing?

(Carsten Rodin) #5

hi @Alain:

I’m the user in question – following this closely because I use a lot of python in Grasshopper in my day-to-day work, and making API requests is particularly important.

Here’s what I’m seeing on my end:

Commenting out that import clears up the issue:

Just to be clear I’m using the Version 6 WIP (6.15.19092.12046, 2019-04-02). Are there any other debugging tools or ways to shed light on the details of the error that I may not know about that would be helpful to pass along?

(Alain Cormier) #6

Hi Carsten,
Issue has been logged and I’ll look at it as soon as I can.
Thank you for reporting,
Alain

(Carsten Rodin) #8

Thanks!

(Dan Belcher) #9

This issue should be fixed in the latest RhinoWIP. Please test your imports and make sure.

(Carsten Rodin) #10

Looking good on urllib2! Thanks

1 Like