[issue41382] print() unpredictable behaviour

2020-07-24 Thread n-io


n-io  added the comment:

Redirecting the stdout of the command to a file (script.py > out) shows the 
output being produced correctly. The bug seems therefore unrelated to python, 
my apologies. Thanks though!

FYI, "$cat out" will reproduce the bug, while "$vi out" will show the correct 
output as expected. Your intuition seemed correct, thanks.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41382] print() unpredictable behaviour

2020-07-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

It would help if you could pare this down to a simpler example, hopefully 
removing the '$'.

For example, does the problem still occur if you '$'s? What if you make all of 
the non-numeric strings 1 character long? What if you delete the non-numeric 
strings?

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41382] print() unpredictable behaviour

2020-07-24 Thread n-io


n-io  added the comment:

The first call you requested (as hinted before, this looks fine to me):
$ python3.8
Python 3.8.3 (default, May 14 2020, 22:09:32) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> "\t".join(['arith_int_512-cuda.sfeat', 
>>> '__hipsyclkernel$wrapped_kernelname$MicroBenchArithmeticKernel_512_1', 
>>> '578', '65', '5', '64', '4', '1025', '128', '1', '1', '512', '1'])
'arith_int_512-cuda.sfeat\t__hipsyclkernel$wrapped_kernelname$MicroBenchArithmeticKernel_512_1\t578\t65\t5\t64\t4\t1025\t128\t1\t1\t512\t1'


I can reproduce the issue on both:

Python 3.8.3 (default, May 14 2020, 22:09:32) 
[GCC 5.4.0 20160609] on linux

Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 26 2018, 19:50:54) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin


The second call you requested `echo 'arith_int_512-'` will say 'command not 
found: arith_.' in bash.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41382] print() unpredictable behaviour

2020-07-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

On MacOS with Python 3.8.2 I get the correct results. Can you give more details 
about the platform and send the result of:


>>> "\t".join(['arith_int_512-cuda.sfeat', 
'__hipsyclkernel$wrapped_kernelname$MicroBenchArithmeticKernel_512_1', '578', 
'65', '5', '64', '4', '1025', '128', '1', '1', '512', '1'])

?


Could you also try `echo 
'arith_int_512-cuda.sfeat\t__hipsyclkernel$wrapped_kernelname$MicroBenchArithmeticKernel_512_1\t578\t65\t5\t64\t4\t1025\t128\t1\t1\t512\t1'`
 in shell? Maybe your terminal emulator behaves weirdly.

--
nosy: +remi.lapeyre

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41382] print() unpredictable behaviour

2020-07-24 Thread n-io


New submission from n-io :

There seems to be a behavioural issue with the print() function. Using 
python3.8 and the following line:

>>> print("\t".join(['arith_int_512-cuda.sfeat', 
>>> '__hipsyclkernel$wrapped_kernelname$MicroBenchArithmeticKernel_512_1', 
>>> '578', '65', '5', '64', '4', '1025', '128', '1', '1', '512', '1']))

arith_int_512-cuda.sfeat
__hipsyclkernel$wrapped_kernelname$MicroBenchArithmeticKernel_512_1578
65564410251285121

Notice the missing numbers between 128 and 512. If I do random modifications 
the either of the first two string, some of the missing numbers may appear. For 
instance:

>>> print("\t".join(['arith_int_512-cuda', 
>>> '__hipsycl_kernel_$wrapped_kernel_name_$MicroBenchArithmeticKernel_512_1', 
>>> '578', '65', '5', '64', '4', '1025', '128', '1', '1', '512', '1']))

arith_int_512-cuda  
__hipsycl_kernel_$wrapped_kernel_name_$MicroBenchArithmeticKernel_512_1 578 
65  5   64  4   1025128 1   512 1

Notice that one of the two missing numbers has appeared. There appears nothing 
wrong with the value used to invoke print.

The error appears to be linked to joining on the "\t" character and does not 
appear to occur when joining on other whitespace characters such as " 
".join(...) or "\n".join(...)

--
components: IO
messages: 374176
nosy: n-io
priority: normal
severity: normal
status: open
title: print() unpredictable behaviour
type: behavior
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com