[Python-bugs-list] [ python-Bugs-558279 ] \verbatiminput and name duplication

noreply@sourceforge.net noreply@sourceforge.net
Mon, 17 Jun 2002 08:02:10 -0700


Bugs item #558279, was opened at 2002-05-20 09:52
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=558279&group_id=5470

Category: Documentation
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Fred L. Drake, Jr. (fdrake)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: \verbatiminput and name duplication

Initial Comment:
The \verbatiminput support which generates file names
for the "Download as text" feature does not check that
the source file names are unique without the extension.
 If a document uses \verbatiminput with two files,
sample.py and sample.html, both get written to the
output as sample.txt; last one processed wins.

----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-06-17 11:02

Message:
Logged In: YES 
user_id=3066

Checked in the second patch as Doc/perl/python.perl revision
1.126 since there have been no complaints.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-05-20 11:53

Message:
Logged In: YES 
user_id=3066

I've added an improved patch that only creates one output
file for each input file, no matter how many times it's
input.  The "Download as text" message in the footer is also
modified to include the original filename if the actual
filename has been modified from the original (which it
always has been unless the original extension was .txt).

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-05-20 11:15

Message:
Logged In: YES 
user_id=3066

I'm attaching a patch that will at least make sure things
work when presented with source filenames that share the
same base name, or are the same file included more than once.

The patch is not ideal:  repeated inclusions are not
detected, so the content will be duplicated for each
inclusion (minor).  The filename generation does not ensure
that a source file's basename will ever be used for a file
with that basename.  For example, including sample.py,
sample.c, and sample-c.c, in that order, will generate the
file names sample.txt, sample-c.txt, and sample-c-c.txt.

Note that filename re-writing is needed to ensure that Web
servers produce the text/plain Content-Type for these files;
there is no reliable way to configure Web servers to produce
 the appropriate headers from the content space.  (We also
need to avoid allowing the output text files to have
extensions of .html since LaTeX2HTML or node2label.pl might
overwrite them.)

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=558279&group_id=5470