play command list modules ignores HTTP_PROXY

Bug #519339 reported by leifg
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
play framework
Fix Committed
Undecided
Unassigned

Bug Description

If you're connecting to a proxy through the internet the play modules commandas (list-modules and install) won't work.

Usually (when working with other commandline tools, such as perl and git) you can specifify your proxy in the system variable HTTP_PROXY. This variable will be omitted in play!

Revision history for this message
Erwan Loisant (eloisant) wrote :

Play uses Python's urllib, and urllib respects the system's proxy config. For Windows it's the registry, for MacOSX the Settings window, and for linux the http_proxy (lowercase!) environment variable.

If you're on Linux, try to set an env variable and let us know.

http://docs.python.org/library/urllib.html#high-level-interface

Revision history for this message
Guillaume Bort (guillaume-bort) wrote :

Any update?

Changed in play:
status: New → Incomplete
Changed in play:
status: Incomplete → Fix Committed
Revision history for this message
pdecat (pdecat) wrote :

Hi,
this problem is still present with Play 1.1.

Here's a quick fix :

pdecat@localhost:~/workspace/thirdparty-products/play$ git diff
diff --git a/framework/pym/play/commands/modulesrepo.py b/framework/pym/play/commands/modulesrepo.py
index 6b33c4c..5ffb248 100644
--- a/framework/pym/play/commands/modulesrepo.py
+++ b/framework/pym/play/commands/modulesrepo.py
@@ -436,7 +436,7 @@ def load_module_list():
 def load_modules_from(modules_server):
     try:
         url = '%s/modules' % modules_server
- proxy_handler = urllib2.ProxyHandler({})
+ proxy_handler = urllib2.ProxyHandler()
         req = urllib2.Request(url)
         req.add_header('Accept', 'application/json')
         opener = urllib2.build_opener(proxy_handler)

Tested on both Ubuntu Linux 10.04 and Windows XP SP3 with a "http_proxy" environment variable.

Best regards,
Patrick.

Revision history for this message
taligent (taligent) wrote :

This problem still exists for Play 1.1.1 on OSX 10.6.5.

I can not install fbconnect without disabling proxies first.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.