[Python-bugs-list] [ python-Bugs-437158 ] null char in string processing

noreply@sourceforge.net noreply@sourceforge.net
Thu, 28 Jun 2001 12:57:06 -0700


Bugs item #437158, was opened at 2001-06-28 11:41
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=437158&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Vadim Suvorov (xxx-bad)
Assigned to: Nobody/Anonymous (nobody)
Summary: null char in string processing

Initial Comment:
The following program was excuted with different 
results in several environments:
Windows ME: 
s = 8 <straaaaaa>
< straaaaaa >

Windows NT: expected result
s = 8 <str     >
< str      >

Sun Solaris 8:
s = 8 <str>
< str >

In all cases, the length and contents of file "s" was 
as expected, equal to s string.

s = "str\0\0\0\0\0"
print "s = ", len(s),  "<" + s + ">"
print "<", str(s), ">"

f = open("s", "wb")
f.write(s)
f.close()


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

>Comment By: Tim Peters (tim_one)
Date: 2001-06-28 12:57

Message:
Logged In: YES 
user_id=31435

What does this have to do with Python?  That is, Python has 
no control over how your terminal displays non-printable 
characters.

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

Comment By: Vadim Suvorov (xxx-bad)
Date: 2001-06-28 11:56

Message:
Logged In: YES 
user_id=85081

Oops. Forgot: Python v. 2.1

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

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