public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r14424 - main/trunk/pym/portage/tests/ebuild
@ 2009-09-25  6:01 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-09-25  6:01 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2009-09-25 06:01:56 +0000 (Fri, 25 Sep 2009)
New Revision: 14424

Modified:
   main/trunk/pym/portage/tests/ebuild/test_array_fromfile_eof.py
Log:
Fix length calculation so it doesn't assume the length of the encoded
string is the same as the unicode string.


Modified: main/trunk/pym/portage/tests/ebuild/test_array_fromfile_eof.py
===================================================================
--- main/trunk/pym/portage/tests/ebuild/test_array_fromfile_eof.py	2009-09-25 05:58:16 UTC (rev 14423)
+++ main/trunk/pym/portage/tests/ebuild/test_array_fromfile_eof.py	2009-09-25 06:01:56 UTC (rev 14424)
@@ -18,9 +18,10 @@
 		#   http://bugs.python.org/issue5334
 
 		input_data = "an arbitrary string"
+		input_bytes = _unicode_encode(input_data,
+			encoding='utf_8', errors='strict')
 		f = tempfile.TemporaryFile()
-		f.write(_unicode_encode(input_data,
-			encoding='utf_8', errors='strict'))
+		f.write(input_bytes)
 
 		f.seek(0)
 		data = []
@@ -28,7 +29,7 @@
 		while not eof:
 			a = array.array('B')
 			try:
-				a.fromfile(f, len(input_data) + 1)
+				a.fromfile(f, len(input_bytes) + 1)
 			except EOFError:
 				# python-3.0 lost data here
 				eof = True




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-25  6:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25  6:01 [gentoo-commits] portage r14424 - main/trunk/pym/portage/tests/ebuild Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox