Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPFS.getinfo doesn't work well on python3 #220

Open
kseistrup opened this issue Nov 14, 2015 · 2 comments
Open

HTTPFS.getinfo doesn't work well on python3 #220

kseistrup opened this issue Nov 14, 2015 · 2 comments
Labels

Comments

@kseistrup
Copy link

Python 3:

$ fsinfo http://www.github.com/
fsinfo: Error - 'HTTPMessage' object has no attribute 'dict'
[/] No description available

Python 2:

$ fsinfo2 http://www.github.com/
[/] No description available
cache-control              no-cache
connection                 close
content-security-policy    default-src *; script-src assets-cdn.github.com; object-src assets-cdn.github.com; style-src 'self' 'unsafe-inline' 'unsafe-eval' assets-cdn.github.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com checkout.paypal.com collector.githubapp.com *.githubusercontent.com *.gravatar.com *.wp.com; media-src 'none'; frame-src 'self' render.githubusercontent.com gist.github.com www.youtube.com player.vimeo.com checkout.paypal.com; font-src assets-cdn.github.com; connect-src 'self' live.github.com wss://live.github.com uploads.github.com status.github.com api.github.com www.google-analytics.com api.braintreegateway.com client-analytics.braintreegateway.com github-cloud.s3.amazonaws.com; base-uri 'self'; form-action 'self' github.com gist.github.com
content-type               text/html; charset=utf-8
date                       Sat, 14 Nov 2015 13:05:17 GMT
public-key-pins            max-age=300; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="JbQbUG5JMJUoI6brnx0x3vZF6jilxsapbXGVfjhN8Fg="; includeSubDomains
server                     GitHub.com
set-cookie                 logged_in=no; domain=.gitpro.ttaallkk.top; path=/; expires=Wed, 14 Nov 2035 13:05:17 -0000; secure; HttpOnly, _gh_sess=eyJzZXNzaW9uX2lkIjoiNWYzNTM0M2RjYmVlOGM1ODFkNTk5MzljZTNjZjk3OTUiLCJfY3NyZl90b2tlbiI6InZ5L21mU2FNVEx4SkdBUjE5NFdoLzNnM2xxVEtvZnFPK21ubU03LzFXaEU9In0%3D--bab56fdfe2767a7f92d06cd1992e086c029e433c; path=/; secure; HttpOnly
status                     200 OK
strict-transport-security  max-age=31536000; includeSubdomains; preload
transfer-encoding          chunked
vary                       X-PJAX, Accept-Encoding
x-content-type-options     nosniff
x-frame-options            deny
x-github-request-id        D99D899D:09B2:29D84735:5647318C
x-request-id               aca1873e07dc979c064a880560812bd4
x-runtime                  0.009096
x-served-by                a128136e4734a9f74c013356c773ece7
x-ua-compatible            IE=Edge,chrome=1
x-xss-protection           1; mode=block

This is community/python-fs 0.5.4 on ArchLinux.

@kseistrup
Copy link
Author

With --debug:

Traceback (most recent call last):
  File "/usr/bin/fsinfo", line 9, in <module>
    load_entry_point('fs==0.5.4', 'console_scripts', 'fsinfo')()
  File "/usr/lib/python3.5/site-packages/fs/commands/fsinfo.py", line 77, in run
    return FSInfo().run()         
  File "/usr/lib/python3.5/site-packages/fs/commands/runner.py", line 352, in run
    return self.do_run(options, args) or 0
  File "/usr/lib/python3.5/site-packages/fs/commands/fsinfo.py", line 55, in do_run
    info = fs.getinfo(path)
  File "/usr/lib/python3.5/site-packages/fs/httpfs.py", line 90, in getinfo
    info = urlopen(url).info().dict
AttributeError: 'HTTPMessage' object has no attribute 'dict'

@lurch
Copy link
Contributor

lurch commented Apr 27, 2016

It's actually a bug in HTTPFS, rather than a bug in fsinfo:

(pyfs34)andrew@shyknee:/tmp/test$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from fs.httpfs import HTTPFS
>>> h = HTTPFS('http://www.github.com')
>>> h.getinfo('/')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/test/pyfs34/lib/python3.4/site-packages/fs/httpfs.py", line 90, in getinfo
    info = urlopen(url).info().dict
AttributeError: 'HTTPMessage' object has no attribute 'dict'

@lurch lurch added the bug label Apr 27, 2016
@lurch lurch changed the title fsinfo doesn't work well on python3 HTTPFS.getinfo doesn't work well on python3 Apr 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants