Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
os
module'sprocess_cpu_count
attribute, thesched_getaffinity
function on Linux systems, or the total number of CPUs in the system, with a default fallback to 1 if all else fails. The parallel task execution functionality has been updated to utilize this available CPU count method to automatically determine the number of threads to use when running tasks concurrently, unless a specific thread count is manually specified, allowing for more accurate and flexible concurrent processing, particularly in containerized environments with imposed CPU quotas._detect_encoding_bom
anddecode_with_bom
, which enable accurate detection of the encoding and decoding of text files. Additionally, the_read_text_from_binary_io
andread_text
methods have been added to read text from binary IO and file paths, respectively, taking into account BOM markers and non-seekable files. The existingopen
method has been updated to utilize thedecode_with_bom
method when opening files in text mode, allowing for improved handling of BOM markers and non-seekable files. Theread_text
function can handle various BOMs, including UTF-8, UTF-16 LE, UTF-16 BE, UTF-32 LE, and UTF-32 BE, and correctly decodes the text, while also supporting sized reads and raising aValueError
for non-seekable files when a size is specified.