Closed
Bug 660695
Opened 15 years ago
Closed 15 years ago
images in documentation don't load on Windows
Categories
(Add-on SDK Graveyard :: Documentation, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
1.0
People
(Reporter: myk, Unassigned)
References
Details
Attachments
(1 file)
|
604 bytes,
patch
|
myk
:
review+
|
Details | Diff | Splinter Review |
On Windows, images in the documentation, like the logo <http://127.0.0.1:8888/media/firefox-32.png>, don't appear.
Trying to load such images directly in a Firefox tab results in the browser complaining that the image contains errors, f.e. the result of trying to load the logo is the message "The image “http://127.0.0.1:8888/media/firefox-32.png” cannot be displayed because it contains errors."
And requesting the image via telnet confirms that invalid data is being returned by the server:
$ cfx docs
...
$ telnet 127.0.0.1 8888
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /media/firefox-32.png HTTP/1.0
HTTP/1.0 200 OK
Date: Mon, 30 May 2011 19:56:13 GMT
Server: WSGIServer/0.1 Python/2.6.5
Content-type: image/png
Content-Length: 5
‰PNG
Connection closed by foreign host.
I don't see this problem on Mac. I haven't tested on Linux yet, but I expect it to work there as well.
Note that loading the directory containing the images also returns errors, although they vary slightly between platforms:
Windows:
http://127.0.0.1:8888/media -> 500 Internal Server Error
http://127.0.0.1:8888/media/ -> 404 Not Found
Mac:
http://127.0.0.1:8888/media -> 500 Internal Server Error
http://127.0.0.1:8888/media/ -> 500 Internal Server Error
Brian: you probably know the most about the Python code serving the docs; do you have a Windows VM yet in which you could troubleshoot this problem?
Comment 1•15 years ago
|
||
I don't yet, let me dive into setting one up. In the meantime, could you try applying this patch and see if it helps matters? Without it, these files are opened in "text" mode, which will clobber newlines and produce corrupt downloads of binary files. It wouldn't explain the "Content-Length: 5" that you saw, nor the 500s, but might explain a browser rejecting the images as being corrupt.
| Reporter | ||
Comment 2•15 years ago
|
||
(In reply to comment #1)
> I don't yet, let me dive into setting one up. In the meantime, could you try
> applying this patch and see if it helps matters? Without it, these files are
> opened in "text" mode, which will clobber newlines and produce corrupt
> downloads of binary files. It wouldn't explain the "Content-Length: 5" that
> you saw, nor the 500s, but might explain a browser rejecting the images as
> being corrupt.
Unfortunately, this patch doesn't make a noticeable difference.
| Reporter | ||
Comment 3•15 years ago
|
||
Comment on attachment 536473 [details] [diff] [review]
make 'cfx docs' server open files in binary mode
Erm, I take that back. The patch does indeed fix the problem. I guess I didn't restart the server after applying it, so the change hadn't taken effect.
r+a=myk
Attachment #536473 -
Flags: review+
Comment 4•15 years ago
|
||
Great! Landed in https://github.com/mozilla/addon-sdk/commit/7fbfefe224eea2bf432662b2642b91d62ade14cf .
BTW, the "500 Internal Server Error" on media/ is the result of an os.open()
trying to open a directory when it's expecting a file. We could map that to a
better error (maybe whatever Apache does when you hit a directory but indexes
are disabled.. Unauthorized?), but it's probably not worth the effort. I
don't know why windows gives different errors for with-slash/without-slash,
but I suspect it involves the return value from os.open().
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•