[p4python] line splitting problem

Robert Cowham robert at vaccaperna.co.uk
Fri Apr 27 14:40:48 PDT 2007

I'll have a look and see what we can do...


> -----Original Message-----
> From: p4python-bounces at perforce.com 
> [mailto:p4python-bounces at perforce.com] On Behalf Of Eric Huss
> Sent: 27 April 2007 17:53
> To: p4python at perforce.com
> Subject: [p4python] line splitting problem
> I ran into a problem with the way that p4python splits output 
> lines.  I was trying to use run_print() to slurp the contents 
> of a file from the depot, but because of the way the lines 
> are split in OutputText, I ended up with the equivalent of 
> empty lines in the output.  Perforce seems to send over the 
> text in batches, so it ended up sending something like:
> 'line1\nline2\nline3\n'
> 'line4\nline5\nline6\n'
> This resulted in output being set to:
> ['line1', 'line2', 'line3', '', 'line4', 'line5', 'line6', '']
> Thus, you cannot use '\n'.join(output) to reconstruct the 
> original file.
> I ended up overriding P4ClientHandler to not split lines, but 
> it would be nice for a more official fix.
> -Eric
> _______________________________________________
> p4python mailing list
> p4python at perforce.com
> http://maillist.perforce.com/mailman/listinfo/p4python

More information about the p4python mailing list