v3.2.1 - 23 Aug 2024
- Test Python 3.12 in CIs by @MatthieuDartiailh in #40
- Bump actions/setup-python from 4 to 5 by @dependabot in #36
- Bump actions/upload-artifact from 3 to 4 by @dependabot in #38
- Bump actions/download-artifact from 3 to 4 by @dependabot in #37
- Fix CI by @thombashi in #41
- Update the CI workflow to include a job that publishes packages to TestPyPI by @thombashi in #42
- Fix coverage report by @thombashi in #45
- Fix
sanitize_filename
truncation by @7x11x13 in #48 - Fix validation functions of filepaths by @thombashi in #55
- If
platform
argument iswindows
oruniversal
, filepaths ending with a space or a period should be detected as an error - Fix POSIX-style absolute paths were not detected as errors with
platform="windows"
orplatform="universal"
on Python 3.12 and below
- If
- Add support for Python 3.13 by @thombashi in #56
- Improve type annotations
- Add a build and publish workflow
- Update copyright year to include the last update year: #54 (Thanks to @Flimm)
- Add CHANGELOG
- @MatthieuDartiailh made their first contribution in #40
- @dependabot made their first contribution in #36
- @thombashi made their first contribution in #41
- @7x11x13 made their first contribution in #48
Full Changelog: https://github.com/thombashi/pathvalidate/compare/v3.2.0...v3.2.1
v3.2.0 - 17 Sep 2023
- Add
reserved_name_handler
argument tosanitize_filename
function andsanitize_filepath
function - Add
NullValueHandler
class andReservedNameHandler
class - Add
fs_encoding
property andbyte_count
property toValidationError
class - Add
additional_reserved_names
argument to validate/sanitize functions to allow custom reserved names - Modify the return value format of
ValidationError.__str__
method - Improve type annotations
Full Changelog: https://github.com/thombashi/pathvalidate/compare/v3.1.0...v3.2.0
v3.1.0 - 16 Jul 2023
- Fix validation error messages to show the
target-platform
properly: #34 (Thanks to @matanster) - Fix README: out of date with the actual error generated by
validate_filename
#35 (Thanks to @hXtreme) - Add
description
property toErrorReason
class - Add
as_slog
method toValidationError
class - Add
docs
extras - Change the type of the return value of
ValidationError.reason
fromOptional[ErrorReason]
toErrorReason
- Update
[build-system]
- Drop support for Python 3.6
Full Changelog: https://github.com/thombashi/pathvalidate/compare/v3.0.0...v3.1.0
v3.0.0 - 22 May 2023
- Trim heading spaces in Windows by @eggplants in #28
- Consider filesystem encoding for length calculations: #26 (Thanks to @virlos)
- Fix type model: #29 (Thanks to @rogalski)
- Fix sanitizing of filenames that only consist of whitespaces and periods
- Add
validate_unprintable_char
function - Add
validate_after_sanitize
keyword argument tosanitize_filename
andsanitize_filepath
functions - Add error codes to
ErrorReason
- Add
zip_safe=False
tosetup
- Modify to accept
pathvalidate.Platform
type asplatform
arguments - Rename type alias from
Handler
toNullValueHandler
- Remove
InvalidLengthError
to useValidationError
- Improve type annotations
- Make it possible to import
FileNameValidator
andFilePathValidator
classes from the package root - Change constructor arguments of
FileNameSanitizer
andFilePathSanitizer
classes- Remove
min_len
- Add
validator
- Remove
- Remove deprecated functions
- Modify error messages
- Refactoring
Full Changelog: https://github.com/thombashi/pathvalidate/compare/v2.5.2...v3.0.0
v2.5.2 - 20 Aug 2022
Full Changelog: https://github.com/thombashi/pathvalidate/compare/v2.5.1...v2.5.2
v2.5.1 - 31 Jul 2022
- Add
__all__
by @eggplants in #24 - Add
DeprecationWarning
to deprecated functions
- @eggplants made their first contribution in #24
Full Changelog: https://github.com/thombashi/pathvalidate/compare/v2.5.0...v2.5.1
v2.5.0 - 26 Sep 2021
- Add support for Python 3.10
- Drop support for Python 3.5
- Add
null_value_handler
argument tosanitize_filename
/sanitize_filepath
functions: #20 (Thanks to @ mkbloke) - Add
AbstractSanitizer
/AbstractValidator
classes to import path - Add
replace_ansi_escape
function - Add
setup-ci
target toMakefile
- Modify
min_len
/max_len
to use default values when assigned minus values
v2.4.1 - 03 Apr 2021
- Fix filename validations that include
'\'
(backslash) on other than Windows: #18 (Thanks to @Traktormaster)
v2.4.0 - 21 Mar 2021
- Add
exclude_symbols
argument toreplace_symbol
function - Fix permissions of files included in
sdist
package binary (Thanks to @hegjon)
v2.3.2 - 03 Jan 2021
- Fix to disallow file name/path that only white spaces for
universal
platform
v2.3.1 - 13 Dec 2020
- Modify to accept file name/path that consists only whitespaces: #15 (Thank to @Traktormaster)
v2.3.0 - 03 May 2020
- Change not to process for
"."
/".."
by sanitization functions: #13 (Thanks to @ProfElectric) - Change to normalize with
sanitize_filepath
in default - Add normalize interface to
sanitize_filepath
v2.2.2 - 28 Mar 2020
- Improve file path validation for Windows platform: #12 (Thanks to @bschollnick)
- Fix
__str__
method - Fix to avoid raise an exception when an absolute path includes
"."
/".."
- Modify an error message
- Modify raising exception from
NullNameError
toValidationError
ofvalidate_pathtype
v2.2.1 - 20 Mar 2020
- Fix to include
py.typed
to the package
v2.2.0 - 12 Feb 2020
- Add
POSIX
as a platform - Add a reserved keyword for macOS
- Change platform of
validate_filepath_arg
/sanitize_filepath_arg
to'auto'
: #11 (Thanks to @freelanceAndy)
v2.1.0 - 01 Feb 2020
- Add
check_reserved
argument to validate/sanitize functions - Add
'/'
as a reserved file path for Linux/macOS - Suppress errors when sanitizing null values
- Fix
max_len
value check for file names - Include type annotation information to the package
- Remove
dev
extras_require - Bug fixes
v2.0.0 - 13 Jan 2020
- Change to be more strict validation for absolute paths
- Fix argparse validator/sanitizer failed when empty inputs
- Bug fixes
v1.1.0 - 04 Jan 2020
- Modify validate/sanitize functions for
argparse
- Modify validate/sanitize functions for
click
- Update
dev
extras
v1.0.0 - 03 Jan 2020
- Drop Python 2 support
- Modify to use Python 3 functionality
- Update
extras_require
- Bug fixes
- Remove a deprecated property
v0.29.1 - 02 Jan 2020
- Fix file path length validation: #10 (Thanks to @UncleGoogle)
- Add
.asc
files of packages to PyPI
v0.29.0 - 16 Jun 2019
- Add filename/filepath validators for
argparse
/click
- Modify error messages
v0.28.2 - 18 May 2019
- Fix to properly escape special chars for validation error messages: #9 (Thanks to @UncleGoogle)
v0.28.0 - 01 May 2019
- Drop support for Python 3.4
v0.26.0 - 15 Mar 2019
- Add support for NTFS reserved names
- Improve drive letter handling
v0.25.0 - 14 Mar 2019
- Add
CLOCK$
as a reserved filename for Windows platform: #8 (Thanks to @sparr) - Improve reserved name detection
- Add
reserved_name
property toReservedNameError
class
v0.24.1 - 12 Feb 2019
- Fix improper error messages
- Improve error message readability
v0.24.0 - 03 Feb 2019
- Add
is_valid_filename
/is_valid_filepath
function - Add
FileNameSanitizer
/FilePathSanitizer
classes - Add minimum length validation support
- Remove deprecated functions
v0.23.0 - 06 Jan 2019
- Improve sanitization/validation for files
- Add
.
and..
as reserved keywords for files - Add limit to
max_filename_len
- Fix platform specific sanitization: #7
- Fix reserved keywords sanitization/validation for files
- Integrate
InvalidCharWindowsError
intoInvalidCharError
- Change to use
ReservedNameError
instead ofInvalidReservedNameError
- Breaking changes
- Rename a property for
FileSanitizer
fromplatform_name
toplatform
- Rename methods argument from
platform_name
toplatform
- Rename a property for
v0.22.0 - 23 Dec 2018
- Add universal (platform independent) filename/filepath sanitization/validation
- Treat ASCII whitespace other than normal space as invalid on Windows #6 (Thanks to @nyuszika7h)
v0.21.1 - 28 Jul 2018
- Add support for PathLike object
- Bug fixes
v0.18.0 - 07 Jul 2018
- Add validations/sanitizations for unprintable characters
- Add support for Python 3.7
v0.15.0 - 18 Mar 2017
- Remove package dependencies
- pathvalidate functions are expected to passing unicode strings.
v0.14.0 - 11 Feb 2017
- Change max file name/path length to configurable
- Add support for Python 3.6
- Bug fixes
v0.13.0 - 03 Jan 2017
- Add JavaScript validator/sanitizer
- Bug fixes
v0.11.0 - 25 Dec 2016
- Add multibyte character validate/sanitize support
v0.10.0 - 23 Dec 2016
- Add LTSV support
v0.9.1 - 17 Nov 2016
- Support UTF8
v0.9.0 - 13 Nov 2016
- Add validate_symbol function
v0.8.2 - 27 Oct 2016
- Fix Windows path validation
- Bug fixes
v0.6.0 - 19 Sep 2016
- Add SQLite name validation function
v0.5.2 - 20 Aug 2016
- Fix validate/sanitize of excel sheet
- Subdividing errors
- Add file name validation for Windows reserved names and path length
v0.5.1 - 23 Jul 2016
- Modify error handling
v0.5.0 - 17 Jul 2016
- Drop support for Python 2.6
- Add validate_excel_sheet_name function
- Add sanitize_excel_sheet_name function
v0.4.2 - 19 Jun 2016
- Make pytest-runner a conditional requirement
v0.4.1 - 29 May 2016
- Modify replace_symbol function behavior
v0.4.0 - 28 May 2016
- Add validate_file_path/sanitize_file_path functions
- Fix validate/sanitize filename functions
- Fix validate/sanitize python variable name functions
v0.3.0 - 22 May 2016
- Add validate_python_var_name function
v0.2.0 - 21 May 2016
- Add sanitize_python_var_name function