Skip to content

Very strange incompatibility with pandas and another library #235

@xmatthias

Description

@xmatthias

Description

I'm encountering a very strange issue - i'm not even sure it's an issue with this library - but i'm looking for help here as i'm kinda clueless where to look at next.

Running the below code (requires external dependencies - as listed below) works just fine, the output beeing

> python testfile.py

ERROR:root:hello world
testtest after

However - when running the command while piping stdout to grep - then stdout is not shown anymore (the same happens when redirecting with ... 1>file.txt.

python testfile.py  | grep test
ERROR:root:hello world

Now the strange thing is - if i remove EITHER the pandas import, or the ccxt import (or both) - then the above code prints out both lines again (hello world because its in stderr, "testtest after" because of the grep).

Now i'm clueless as to what could cause this - as obviously it's not one library alone - but the combination of the 2 that seems to have this effect.

Using the debugger, i could see no difference in progressbar.streams - but i'm not that experienced debugging this library / with this library.

I've got the example drilled down as much as possible, so it's not doing much anymore other than print and log (my usecase is a lot complexer and DOES involve the progressbar - but actually showing the progressbar seems irrelevant in this case).

Code

pip install ccxt==1.34.7 pandas==1.1.1
import sys
import time
import logging
import progressbar

# Removing either of the following 2 imports will make the example work
import pandas as pd
import ccxt.async_support


progressbar.streams.wrap_stderr()
progressbar.streams.wrap_stdout()
logging.basicConfig()


logging.error("hello world")
print("testtest after")
# sys.exit()

Versions

  • Python version: 3.8.2 (default, Apr 26 2020, 13:27:05)
  • Python distribution/environment: CPython
  • Operating System: Linux
  • Package version: 3.52.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions