playframework / play1

Play framework
https://www.playframework.com/documentation/1.4.x/home
Other
1.58k stars 683 forks source link

Fix missing HTTPMessage.getHeader() #1444

Closed runlevel5 closed 7 months ago

runlevel5 commented 1 year ago

Info

Steps to reproduce:

./play install cas 3.0
~ Will install cas-3.1
~ This module is compatible with: 1.1.x, 1.2.x
~ Do you want to install this version (y/n)? y
~ Installing module cas-3.1...
~
~ Fetching https://www.playframework.com/modules/cas-3.1.zip
Traceback (most recent call last):
  File "./pp/play", line 168, in <module>
    status = cmdloader.commands[play_command].execute(command=play_command, app=play_app, args=remaining_args, env=play_env, cmdloader=cmdloader)
  File "/Users/tle/Work/clui/pp/framework/pym/play/commands/modulesrepo.py", line 67, in execute
    install(app, args, env)
  File "/Users/tle/Work/clui/pp/framework/pym/play/commands/modulesrepo.py", line 476, in install
    Downloader().retrieve(fetch, archive)
  File "/Users/tle/Work/clui/pp/framework/pym/play/commands/modulesrepo.py", line 103, in retrieve
    self.chunk_read(result, destination, report_hook=self.chunk_report)
  File "/Users/tle/Work/clui/pp/framework/pym/play/commands/modulesrepo.py", line 120, in chunk_read
    total_size = response.info().headers['Content-Length'].strip()
AttributeError: 'HTTPMessage' object has no attribute 'headers'

Context

The response.info() returns HTTPMessage object in Python 3 and no longer have the getHeader() method.

xael-fry commented 7 months ago

Merge in master Thanks @runlevel5