Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command output redirect generates "empty" files #7

Closed
kartben opened this issue Sep 18, 2024 · 4 comments
Closed

Command output redirect generates "empty" files #7

kartben opened this issue Sep 18, 2024 · 4 comments
Assignees
Labels
bug The software does not behave as expected or documented

Comments

@kartben
Copy link

kartben commented Sep 18, 2024

When doing e.g. the following command (which works fine without redirecting output):

ls -R --format NcrYd > board.html

I get an "empty" file (except for the template). Same happens with .txt and .svg

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">

<style>

body {
    color: #000000;
    background-color: #ffffff;
}
</style>
</head>

<body>

    <pre style="font-family:Courier New, monospace"><code></code></pre>

</body>

</html>

This is with v0.2.3

@kartben
Copy link
Author

kartben commented Sep 18, 2024

I should add this is on macOS/Python 3.12 but can also reproduce on 3.10 on Linux

@dottspina dottspina self-assigned this Sep 21, 2024
@dottspina
Copy link
Owner

dottspina commented Sep 22, 2024

Thank you for reporting this.

I was finally able to reproduce the issue ... by upgrading the Textualize rich library.

It seems that the problem in DTSh is rooted in a recent change to rich.console (commit #a3b27a3), which doesn't mean the bug is on their side: I'll dig into that.

In the meantime, could you please try downgrading the library (anything bellow version 13.8.0), e.g.:

pip install rich==13.7.1

This workaround should at least let you play with DTSh.

Thanks.

References (rich):

@dottspina dottspina added the bug The software does not behave as expected or documented label Sep 22, 2024
dottspina added a commit that referenced this issue Oct 11, 2024
Workaround for: Command output redirect generates "empty" files

See also: #7
dottspina added a commit that referenced this issue Oct 11, 2024
Maintenance release, needed to distribute DTSh
on PyPI with a pinned version of the rich library.

See also: #7
@dottspina
Copy link
Owner

Automatically closed by commit ea1eaf5: reopened to allow the issuer to confirm the fix.
Thanks.

@dottspina dottspina reopened this Nov 8, 2024
@kartben
Copy link
Author

kartben commented Nov 22, 2024

This is now fixed indeed, thank you!

@kartben kartben closed this as completed Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The software does not behave as expected or documented
Projects
None yet
Development

No branches or pull requests

2 participants