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

Python 3.9.6 causes warning about buffering for binary mode #922

Open
wvolz opened this issue Aug 17, 2021 · 5 comments
Open

Python 3.9.6 causes warning about buffering for binary mode #922

wvolz opened this issue Aug 17, 2021 · 5 comments
Labels

Comments

@wvolz
Copy link

wvolz commented Aug 17, 2021

Running Carbon 1.1.8 is causing a warning when starting up under Python 3.9.6:

lib/python3.9/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used

I believe the issue is caused by the "1" on this line:

self.path, os.O_CREAT | os.O_RDWR, openMode), 'rb+', 1)

@stale
Copy link

stale bot commented Oct 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 17, 2021
@deniszh
Copy link
Member

deniszh commented Oct 17, 2021

Should be addressed

@stale stale bot removed the stale label Oct 17, 2021
@JohnHay
Copy link

JohnHay commented Oct 17, 2021

I also see it on FreeBSD with python 3.8.12:

Starting carbon.
Starting carbon-cache (instance a)
/usr/local/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
  return io.open(fd, *args, **kwargs)

@stale
Copy link

stale bot commented Dec 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 16, 2021
@deniszh deniszh added the pinned label Dec 17, 2021
@stale stale bot removed the stale label Dec 17, 2021
earthgecko added a commit to earthgecko/carbon that referenced this issue Feb 7, 2024
This is a fix for  Python 3.9.6 causes warning about buffering for binary mode graphite-project#922, setting this to 0 is the default behaviour and results in the default buffer size being used.

The warning was released in Python 3.8.0 and is still present in 3.10.13 (tested, works and logging works fine) and is still present in 3.12.2 (https://github.com/python/cpython/blob/v3.12.2/Lib/_pyio.py#L231)

The version check may be excessive because who would be running < 3.8.0, but you never know.
@RedShiba
Copy link

catching the same issue

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

No branches or pull requests

4 participants