Turning off of local echo; empty file named '-' was created

Hi all,

With root v5.25/02 on Fedora 11 (i386, fully updated),
[ul]

  • after importing TH1 to python, an empty file named “-” is created,
  • and after exiting python, local echo is turned off,
    [/ul]
    as the following:

[code][furutaka@Furutaka-1 tmptmp] cat /etc/fedora-release Fedora release 11 (Leonidas) [furutaka@Furutaka-1 tmptmp] ls
[furutaka@Furutaka-1 tmptmp]$ python
Python 2.6 (r26:66714, Jun 8 2009, 16:07:26)
[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

from ROOT import TH1

[furutaka@Furutaka-1 tmptmp]$ total 0
-rw-------. 1 furutaka furutaka 0 2009-10-09 11:55 -
[/code]

In the above, after exiting python I did ls -l.

Invoking root and exiting turns the local echo on again.

By importing TFile for example, the file is not created but local echo is turned off.

These don’t occur on recent debian(5.0.3, i386, with Python 2.5.2).

Any clue?

Thanks in advance.

Kazuyoshi

[quote=“furutaka”]With root v5.25/02 on Fedora 11 (i386, fully updated),
[ul]

  • after importing TH1 to python, an empty file named “-” is created,
  • and after exiting python, local echo is turned off,
    [/ul][/quote]

The same occurs on Gentoo systems (i386 as well asl alpha):

[code]furutaka@Gentoo_x86 ~ ls Desktop res rootlogon.C work furutaka@Gentoo_x86 ~ uname -a
Linux Gentoo_x86 2.6.30-gentoo-r6 #1 SMP Thu Sep 17 05:07:05 JST 2009 i686 AMD Athlon™ 64 X2 Dual Core Processor 4600+ AuthenticAMD GNU/Linux
furutaka@Gentoo_x86 ~ $ python
Python 2.6.2 (r262:71600, Oct 1 2009, 20:22:39)
[GCC 4.1.2 (Gentoo 4.1.2 p1.3)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

from ROOT import TH1

furutaka@Gentoo_x86 ~ $ - Desktop res rootlogon.C work
[/code]

[code]furutaka@genalpha ~ ls Desktop res rootlogon.C work furutaka@genalpha ~ uname -a
Linux genalpha 2.6.30-gentoo-r6 #1 SMP Sun Sep 20 15:48:20 JST 2009 alpha EV56 EB164 GNU/Linux
furutaka@genalpha ~ $ python
Python 2.6.2 (r262:71600, Oct 1 2009, 20:45:28)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

from ROOT import TH1

furutaka@genalpha ~ $ - Desktop res rootlogon.C work
[/code]

Kazuyoshi

Kazuyoshi,

eh … :open_mouth:

anything in either rootlogon.C, ~/rootlogon.py, or in $PYTHONSTARTUP that could explain this behavior? Needless to say, I can’t reproduce it …

Cheers,
WIm

Hi Wim,

Well, even with a newly created account without init files such as ~/rootlogon.C and ~/.rootrc, it does occur (I made sure this morning)…
I also tried after removing all the files under $ROOTSYS and reinstalling, but it does. :unamused:

It does NOT occur with root v5.24/00.

Kazuyoshi

Kazuyoshi,

what happens if you keep on typing? Does the file ‘-’ get filled with the stuff you’d normally expect to show up on stdout?

Cheers,
Wim

Hi Wim,

No. It remains empty.

[code][furutaka@Peart tmptmp]$ python
Python 2.6 (r26:66714, Jun 8 2009, 16:07:29)
[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

from ROOT import TH1
print “This is just a test.”
This is just a test.

[furutaka@Peart tmptmp]$ total 0
-rw-------. 1 furutaka furutaka 0 2009-10-10 09:16 -[/code]

Actually I found this while running an old script I wrote months ago.

Yours,
Kazuyoshi

A few additional notes…

At least on Gentoo x86 with Python 2.6.2, importing TFile also creates the file…

The file is created on exiting (CTRL-D).

Kazuyoshi

Kazuyoshi,

well, I have no idea where to get started on this one (searching for ‘-’ with google is kinda hard). I’ve hardly made any changes between 5.24 and trunk, so I doubt that it is the python side.

What can still be, is some weird interaction with ncurses (we’ve had spurious characters on shutdown on a RH box a while back, which occurred b/c a very specific version of ncurses and a very specific version of readline did not like each other, given certain values of the TERM envar).

Can you edit your local ROOT.py file to not setup readline and history? Basically remove the whole piece between: ‘## readline support, if available’ and ‘## special filter on MacOS X …’?

Cheers,
Wim

Hi Wim,

I commented out a fragment of codes to support readline in $ROOTSYS/lib/ROOT.py.
Even with the modified version, the “-” file is created and local echo is turned off… :unamused:

Kazuyoshi

Hi,

strace-ing with -i indicated that the “-” file was created at the following address:

[      37dced129b] open("-", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 19

and using gdb I set a break point at the address and took the backtrace, which is attached to this post.

I hope this is not useless…

Kazuyoshi
bt.txt (3.76 KB)

Kazuyoshi,

editline appears to be something new indeed: I only noticed it this week when I did an svn update, and editline did not configure nor compile properly on my system.

I’ll ask around on ROOTDEV.

In the meantime, it can be disabled with ‘–disable-editline’ as argument to configure. I’m not certain for what it is used, but disabling it did not affect any of my normal tests.

Cheers,
Wim

Hi,

it’s fixed in the trunk. Thanks for your debugging efforts, Kazuyoshi! The backtrace was very helpful.

Cheers, Axel.

Hi,

The creation of the empty file named “-” had disappeared in ROOT 5.25/03, trunk@30738. Also, with the version, local echo is normal after exiting PyROOT session!!!

Thank you too, Axel and Wim, for your effort to fix it! :smiley:

Yours,
Kazuyoshi

Hi,

no problem thanks to your backtrace! Let’s file it under “combined effort” :wink:

Cheers, Axel.