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

Python 2.1b1 - pydoc shows nothing #34075

Closed
pfmoore opened this issue Mar 6, 2001 · 5 comments
Closed

Python 2.1b1 - pydoc shows nothing #34075

pfmoore opened this issue Mar 6, 2001 · 5 comments
Labels
stdlib Python modules in the Lib dir

Comments

@pfmoore
Copy link
Member

pfmoore commented Mar 6, 2001

BPO 406280
Nosy @gvanrossum, @tim-one, @pfmoore

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2001-04-13.12:48:49.000>
created_at = <Date 2001-03-06.13:06:24.000>
labels = ['library']
title = 'Python 2.1b1 - pydoc shows nothing'
updated_at = <Date 2001-04-13.12:48:49.000>
user = 'https://github.com/pfmoore'

bugs.python.org fields:

activity = <Date 2001-04-13.12:48:49.000>
actor = 'ping'
assignee = 'ping'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2001-03-06.13:06:24.000>
creator = 'paul.moore'
dependencies = []
files = []
hgrepos = []
issue_num = 406280
keywords = []
message_count = 5.0
messages = ['3716', '3717', '3718', '3719', '3720']
nosy_count = 4.0
nosy_names = ['gvanrossum', 'tim.peters', 'ping', 'paul.moore']
pr_nums = []
priority = 'low'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue406280'
versions = []

@pfmoore
Copy link
Member Author

pfmoore commented Mar 6, 2001

Platform: Windows 2000, Python 2.1b1

The pydoc script works fine in "serve documents to a
browser" mode (python pydoc). Also, running it as a
command line application, as "python pydoc pydoc",
works fine when the environment variable PAGER is
unset.

However, when I have PAGER=less, I get no output at
all.

It looks like a bug in pydoc.pipepager(), which is the
result of a bug in os.popen(). I can work around the
bug by using pydoc.tempfilepager() in place of
pydoc.pipepager(), but I don't know what the
underlying popen() bug is.

To demonstrate the os.popen() bug, see the attached
interactive session:

C:\Data>python21
Python 2.1b1 (#11, Mar  2 2001, 11:23:29) [MSC 32 bit 
(Intel)] on win32
Type "copyright", "credits" or "license" for more 
information.
>>> import os
>>> a = os.popen("more", "w")
>>> a.write("Hello")
>>> a.close()

Run this, and note that the "More" program never
starts...

@pfmoore pfmoore closed this as completed Mar 6, 2001
@pfmoore pfmoore added the stdlib Python modules in the Lib dir label Mar 6, 2001
@pfmoore pfmoore closed this as completed Mar 6, 2001
@pfmoore pfmoore added the stdlib Python modules in the Lib dir label Mar 6, 2001
@gvanrossum
Copy link
Member

Logged In: YES
user_id=6380

Assigned to Tim, because of that fine combination of
keywords:
popen and Windows.

@tim-one
Copy link
Member

tim-one commented Mar 17, 2001

Logged In: YES
user_id=31435

Assigned to MarkH for popen insight.

"more" does start, but the output just vanishes under
Win98SE (and, I assume, W2K too). This I deduced via doing
os.popen("more > somefile.txt", "w") instead; the file is
created, and does contain the stuff written to the handle.
Besides, the std test_popen2 test uses "more" under Windows
too, and works fine.

Nothing unique about "more" here: tried a number of .exe
files, and it's all the same: the stdout of the popen'ed
program isn't displayed. I assume this is because the
original console's stdout doesn't manage to become the
popen'ed stdout, but I don't understand it in detail. Deep
or shallow?

In any case, trying to implement a pager via popen like
this goes beyond what C guarantees, so I reduced the
priority accordingly.

@tim-one
Copy link
Member

tim-one commented Apr 9, 2001

Logged In: YES
user_id=31435

Reassigned to Ping since wrestling w/ popen() on Windows is
hopeless. Left the priority low because it's gotta be rare
for anyone to define a PAGER envar under Windows. Note
that Paul mailed some kind of related patch to Python-Dev
recently ... mumble, mumble, ... here:

http://mail.python.org/pipermail/python-dev/2001-
April/014070.html

@ping
Copy link
Mannequin

ping mannequin commented Apr 13, 2001

Logged In: YES
user_id=45338

Fixed by always using temp files in Windows.
New version is checked in.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

3 participants