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

Error when opening docstring #765

Open
uprokevin opened this issue Mar 28, 2023 · 1 comment
Open

Error when opening docstring #765

uprokevin opened this issue Mar 28, 2023 · 1 comment

Comments

@uprokevin
Copy link

Is it related to those python flags ?

# Keeps Python from generating .pyc files in the container
export PYTHONDONTWRITEBYTECODE=1   

# Turns off buffering for easier container logging
export PYTHONUNBUFFERED=1          

#### Remove Assert and Docstring
export PYTHONOPTIMIZE=2 


Code:

        if "s3:/" in dirs3:
          session = aws_get_session()
          with open(dirs3, mode=mode, transport_params={'client': session.client("s3")}  ) as fp:
             ddict = json.load(fp)

####Error message:

2023-03-27T23:45:37.482212821Z,"ERROR  ,Encountered a non-fatal error while building docstrings (see below). help(smart_open) will provide incomplete information as a result. For full help text, see <https://github.com/RaRe-Technologies/smart_open/blob/master/help.txt>."
2023-03-27T23:45:37.482478954Z,"ERROR  ,'NoneType' object has no attribute 'split'"
2023-03-27T23:45:37.482488402Z,Traceback (most recent call last):
2023-03-27T23:45:37.482492526Z,"  File ""/opt/miniconda/lib/python3.8/site-packages/smart_open/smart_open_lib.py"", line 512, in <module>"
2023-03-27T23:45:37.482496478Z,    doctools.tweak_open_docstring(open)
2023-03-27T23:45:37.482499871Z,"  File ""/opt/miniconda/lib/python3.8/site-packages/smart_open/doctools.py"", line 189, in tweak_open_docstring"
2023-03-27T23:45:37.482502592Z,    print('    %s' % submodule.__doc__.split('\n')[0])
2023-03-27T23:45:37.482505449Z,AttributeError: 'NoneType' object has no attribute 'split'

@mpenkov
Copy link
Collaborator

mpenkov commented Mar 28, 2023

Yes, I think this is the cause:

#### Remove Assert and Docstring
export PYTHONOPTIMIZE=2 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants