- Migrated from setuptools to hatch
- Support Python 3.10, 3.11, and 3.12
- Drop support for Python 3.6 and 3.7
- Breaking: The
move_first
argument has been removed. Only themove_first=False
semantics are retained. - Removed the
readall()
method. I don't think it ever worked. - Breaking: The
delay_open
argument andopen()
method have been removed. Filehandles will now always be created at the moment an in-place instance is constructed, just like when calling the standard library'sopen()
. - Breaking: When the input path points to a symlink and
backup_ext
is given, the backup extension will now be appended to the resolved path rather than to the pre-resolved path. - Added type annotations
InPlaceText
andInPlaceBytes
(deprecated in v0.4.0) have been removed- Added
read1()
andreadinto1()
methods for binary mode - The
InPlace
constructor now immediately raises aValueError
ifbackup
is the empty string
- Support Python 3.8 and 3.9
- Drop support for Python 2.7, 3.4, and 3.5
- Support
move_first
on Windows - Get tests to pass on Windows
- Use
jaraco.windows
to handle symlinks on Windows on versions of Python prior to 3.8
- Breaking: Combined all classes' functionality into a single
InPlace
class that uses amode
argument to determine whether to operate in text or binary mode. InPlaceBytes
andInPlaceText
are now deprecated and will be removed in a future version; please useInPlace
withmode='b'
ormode='t'
instead.- Support fsencoded-bytes as file paths under Python 3
- Handling of symbolic links is changed: Now, if
in_place
is asked to operate on a symlinklink.txt
that points torealfile.txt
, it will act as though it was asked to operate onrealfile.txt
instead, and the pathlink.txt
will only be used when combining withbackup_ext
to construct a backup file path - Drop support for Python 2.6 and 3.3
- Renamed
InPlace
toInPlaceText
and added a newInPlace
class for reading & writingstr
objects (whatever those happen to be in the current Python) - Bugfix: If the given file does not exist and
move_first
isTrue
, an empty file will no longer be left behind in the nonexistent file's place. - Specifying both
backup
andbackup_ext
will now produce aValueError
- Specifying an empty
backup_ext
will now produce aValueError
Rename package & module from "inplace
" to "in_place
" (I could have sworn I
had already checked PyPI for name conflicts....)
Initial release