Re: Python web server weirdness SOLVED

2018-06-08 Thread Gregory Ewing

Steven D'Aprano wrote:
Never mind -- it turned out I had an "index.html" file in the directory 
which had been wget'ed from LiveJournal.


That's okay, then. The other possibility was that your computer
had been recruited into an evil botnet set up by LiveJournal
to create backup servers for their site...

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python web server weirdness

2018-06-07 Thread Steven D'Aprano
On Thu, 07 Jun 2018 13:32:10 +, Steven D'Aprano wrote:

> python3.5 -m http.server 8000
[...]


Thank you to everyone who responded, pointing out that I should check for 
an index.html file. That was exactly the problem.

And yes, I acknowledge that my original post was lacking in some 
necessary debugging detail. Mea culpa.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python web server weirdness

2018-06-07 Thread Tim Chase
On 2018-06-07 13:32, Steven D'Aprano wrote:
> I'm following the instructions here:
> 
> https://docs.python.org/3/library/http.server.html
> 
> and running this from the command line as a regular unprivileged
> user:
> 
> python3.5 -m http.server 8000
> 
> What I expected was a directory listing of my current directory.
> 
> What I got was Livejournal's front page.

A couple things to check:

1) you don't mention which URL you pointed your browser at.  I
*presume* it was http://localhost:8000 but without confirmation, it's
hard to tell.  Also, you don't mention if you had anything in the
{path} portion of the URL such as
"http://localhost:8000/livejournal_homepage.html;

2) you don't mention whether your command succeeded with "Serving
HTTP on 0.0.0.0 port 8000" or if it failed because perhaps something
else was listening on that port ("OSError: [Errno 98] Address already
in use").

3) when your browser made the request to that localhost URL, did that
command produce output logging the incoming requests?

4) do you have any funky redirection for localhost in your /etc/hosts
file (or corresponding file location on Windows)

-tkc



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python web server weirdness

2018-06-07 Thread Ed Kellett
On 2018-06-07 14:32, Steven D'Aprano wrote:
> I'm following the instructions here:
> 
> https://docs.python.org/3/library/http.server.html
> 
> 
> and running this from the command line as a regular unprivileged user:
> 
> python3.5 -m http.server 8000
> 
> What I expected was a directory listing of my current directory.
> 
> What I got was Livejournal's front page.
> 
> W.T.F.???
> 
> 

Do you have LiveJournal's index.html in your current directory?



signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python web server weirdness SOLVED

2018-06-07 Thread Steven D'Aprano
On Thu, 07 Jun 2018 13:32:10 +, Steven D'Aprano wrote:

[...]
> python3.5 -m http.server 8000
> 
> What I expected was a directory listing of my current directory.
> 
> What I got was Livejournal's front page.

Never mind -- it turned out I had an "index.html" file in the directory 
which had been wget'ed from LiveJournal. When I deleted that, it worked 
as expected.




-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python web server weirdness

2018-06-07 Thread Grant Edwards
On 2018-06-07, Steven D'Aprano  wrote:
> I'm following the instructions here:
>
> https://docs.python.org/3/library/http.server.html
>
>
> and running this from the command line as a regular unprivileged user:
>
> python3.5 -m http.server 8000
>
> What I expected was a directory listing of my current directory.
>
> What I got was Livejournal's front page.

That's very odd. What I get is the message below:

$ python3.5 -m http.server 8000
Serving HTTP on 0.0.0.0 port 8000 ...

-- 
Grant Edwards   grant.b.edwardsYow! I invented skydiving
  at   in 1989!
  gmail.com

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python web server weirdness

2018-06-07 Thread Grant Edwards
On 2018-06-07, Steven D'Aprano  wrote:
> I'm following the instructions here:
>
> https://docs.python.org/3/library/http.server.html
>
>
> and running this from the command line as a regular unprivileged user:
>
> python3.5 -m http.server 8000
>
> What I expected was a directory listing of my current directory.
>
> What I got was Livejournal's front page.

Looking into the crystal ball and guessing that "got" means you
pointed a browser at "http://localhost:8000/;...

Do you have a file named "index.html" in your home directory?

https://docs.python.org/3/library/http.server.html

  If the request was mapped to a directory, the directory is checked
  for a file named index.html or index.htm (in that order). If found,
  the file’s contents are returned;

-- 
Grant Edwards   grant.b.edwardsYow! I want another
  at   RE-WRITE on my CEASAR
  gmail.comSALAD!!

-- 
https://mail.python.org/mailman/listinfo/python-list


Python web server weirdness

2018-06-07 Thread Steven D'Aprano
I'm following the instructions here:

https://docs.python.org/3/library/http.server.html


and running this from the command line as a regular unprivileged user:

python3.5 -m http.server 8000

What I expected was a directory listing of my current directory.

What I got was Livejournal's front page.

W.T.F.???


-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list