You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed some buggy behavior when trying to use httpserver and httpretrieve in a pure Python script using repyhelper.
There seems to be an issue with the callback function given to httpserver_registercallback() not having access certain code imported using repyhelper's translate_and_import() function. In the attached file, I try to run a simple webpage on localhost:1234 using httpserver_registercallback(). Running it with the version of httpserver.repy currently in trunk results in nothing being retrieved upon request. However, changing the break statement on line 216 of httpserver.repy to a raise causes the following exception to be thrown:
Exception (with type 'exceptions.NameError'): global name '_httpretrieve_parse_responseheaders' is not defined
For some reason, methods within httpretrieve.repy aren't accessible to the callback function.
The text was updated successfully, but these errors were encountered:
Author: cemeyer
The break statement was not casually thrown in to intentionally make it hard to debug things; instead, I realized that it made debugging things very challenging, but weighed in the consequences of raising an exception and killing the server when an exception happened. Obviously it's not written in stone and can be flipped trivially.
Although it is in this case masking an error in something else, I suppose that the real bug Evan found is in repyhelper or the namespace layer.
Author: justinc
I've committed a fix to repyhelper in r3485.
The problem was that names that start with '' aren't imported. I've changed repyhelper to import names that start with '', but not '' names (to avoid problems with things like __name).
On an unrelated note, content_type is undefined on line 12 of debug.py. This is just a problem with the example and doesn't impact the fix.
I noticed some buggy behavior when trying to use httpserver and httpretrieve in a pure Python script using repyhelper.
There seems to be an issue with the callback function given to httpserver_registercallback() not having access certain code imported using repyhelper's translate_and_import() function. In the attached file, I try to run a simple webpage on localhost:1234 using httpserver_registercallback(). Running it with the version of httpserver.repy currently in trunk results in nothing being retrieved upon request. However, changing the
break
statement on line 216 of httpserver.repy to araise
causes the following exception to be thrown:For some reason, methods within httpretrieve.repy aren't accessible to the callback function.
The text was updated successfully, but these errors were encountered: