gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
59 stars 38 forks source link

urllib.urlopen no longer works #139

Open dllargent opened 3 years ago

dllargent commented 3 years ago

When I last ran my code a year ago (April 2020), urllib.urlopen would allow me to provide a URL and make a connection to it, subsequently using the read method to retrieve the page's content. When I run code now, I get the following error messages.

The error was: event executor terminated A Python RejectedExecutionException happened while running your program, so it stopped. in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\jes\python\jes\core\interpreter__init.py, on line 157, in function run in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\jes\python\jes\core\interpreter\init__.py, on line 188, in function execute in file C:\Users\dllargent\OneDrive - Ball State University\Desktop\deleteme.py, on line 5, in function in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\urllib.py, on line 87, in function urlopen in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\urllib.py, on line 213, in function open in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\urllib.py, on line 213, in function open in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\urllib.py, on line 443, in function open_https in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 1053, in function endheaders in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 897, in function _send_output in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 859, in function send in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 1270, in function connect in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 835, in function connect in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 1518, in function create_connection in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 1518, in function create_connection in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 1391, in function meth in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 891, in function connect in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 860, in function _connect RejectedExecutionException: java.util.concurrent.RejectedExecutionException: event executor terminated Please check line 4 of C:\Users\dllargent\OneDrive - Ball State University\Desktop\deleteme.py

I replicated the issue with the following code:

import urllib url = "https://www.bsu.edu/" print url response = urllib.urlopen(url) print response

It prints the URL and then stops on the fourth line, displaying the above errors. I am running JES 6.0 on Windows.

mjguzdial commented 3 years ago

I'm getting the same thing here, on MacOS JES 6.0. I'm getting a bit more in the Console:

Apr 19, 2021 1:10:38 PM org.python.netty.channel.AbstractChannel$AbstractUnsafe register

WARNING: Force-closing a channel whose registration task was not accepted by an event loop: [id: 0xb593775f]

java.util.concurrent.RejectedExecutionException: event executor terminated at org.python.netty.util.concurrent.SingleThreadEventExecutor.reject(Sin

I check in Python 2.7.16, and that works:

Python 2.7.16 (default, Jun 5 2020, 22:59:21)

[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin

Type "help", "copyright", "credits" or "license" for more information.

import urllib

url = "http://www.cnn.com"

response = urllib.urlopen(url)

print response

<addinfourl at 4448549344 whose fp = <socket._fileobject object at 0x108108450>>

response.close()

I'm cc-ing MediaComp teachers, to see if anyone else has noticed this behavior.


Mark Guzdial, @.***

On Sun, Apr 18, 2021 at 10:33 PM David Largent @.***> wrote:

When I last ran my code a year ago (April 2020), urllib.urlopen would allow me to provide a URL and make a connection to it, subsequently using the read method to retrieve the page's content. When I run code now, I get the following error messages.

The error was: event executor terminated A Python RejectedExecutionException happened while running your program, so it stopped. in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\jes\python\jes\core\interpreter init.py, on line 157, in function run in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\jes\python\jes\core\interpreter init.py, on line 188, in function execute in file C:\Users\dllargent\OneDrive - Ball State University\Desktop\deleteme.py, on line 5, in function in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\urllib.py, on line 87, in function urlopen in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\urllib.py, on line 213, in function open in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\urllib.py, on line 213, in function open in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\urllib.py, on line 443, in function open_https in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 1053, in function endheaders in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 897, in function _send_output in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 859, in function send in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 1270, in function connect in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib\httplib.py, on line 835, in function connect in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 1518, in function create_connection in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 1518, in function create_connection in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 1391, in function meth in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 891, in function connect in file C:\Program Files (x86)\JES\jes-6.0-windows-java-included\dependencies\jython\Lib_socket.py, on line 860, in function _connect RejectedExecutionException: java.util.concurrent.RejectedExecutionException: event executor terminated Please check line 4 of C:\Users\dllargent\OneDrive - Ball State University\Desktop\deleteme.py

I replicated the issue with the following code:

import urllib url = "https://www.bsu.edu/" print url response = urllib.urlopen(url) print response

It prints the URL and then stops on the fourth line, displaying the above errors. I am running JES 6.0 on Windows.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gatech-csl/jes/issues/139, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBN7JXWZF4UUDOIVDOC3VTTJOI7ZANCNFSM43E42DNQ .