Timeline



Jan 2, 2020:

11:12 PM Ticket #133 (Use Hypothesis to find more bugs in the time parsing) created by schwa
Given the bug in #131 and another one found while working on …
10:49 PM Changeset [1902:93d4fddb80c3] by Stefan Schwarzer <sschwarzer@…>
Fix and refactor `parse_unix_time` While changing `parse_unix_time` to use `datetime` instead of time tuples, I noticed that time shift wasn't taken into account for the case where only a year but no time was given. I noticed that the unix time parser tests had the time shift set to 0, so these bugs weren't found. That said, it's still to decide if it makes sense to subtract a time shift if we now a time only up to day precision. But I think we should apply the same rules regarding time shift regardless of the presence of hour and minute. This is just consistent and needs fewer special rules (the one for the unknown hour:minute case). TODO: I still need to improve the tests to use a time shift so that the previous bug is revealed. I want to run these improved tests on the old code to make sure the bug is present there. `_mktime` isn't deleted yet because it's also used by the MS line parser, but I plan to switch this to `datetime` usage, too.
10:01 PM Ticket #132 (Simplify `ftputil.error`) closed by schwa
fixed: As it turned out, original_exception wasn't used for exception …
9:54 PM Changeset [1901:616e46ca84e0] by Stefan Schwarzer <sschwarzer@…>
Simplify conversion of original exception In Python 3, exception messages are always unicode strings (`str`), so special handling for byte string messages is no longer necessary. When I entered ticket #132, I was under the impression that `original_exception` was used for exeption chaining and that it could be removed now. However, `original_exception` is only used to apply `str(original_exception)` and this use makes sense.
9:42 PM Changeset [1900:102788710723] by Stefan Schwarzer <sschwarzer@…>
Remove `os.fspath` call from `same_string_type_as` As with the `as_str` name, the implicit `os.fspath` call is unexpected. Fortunately, the few call sites and unit tests were easy to adapt.
9:11 PM Changeset [1899:a90d4f585563] by Stefan Schwarzer <sschwarzer@…>
Split `as_str` Split `as_str` into a new `as_str` and `as_str_path`. Not all applications of the previous `as_str` were on paths, so their use was confusing. Additionally, even where processing of `PathLike` objects is desired, the name `as_str` is bad because it doesn't suggest at all that `PathLike` processing may happen.
8:54 PM Changeset [1898:31ad8b3fcd2e] by Stefan Schwarzer <sschwarzer@…>
Remove `ftputil.tool.as_bytes` It's no longer necesary in any of the modules.
8:52 PM Changeset [1897:f1349dbc8276] by Stefan Schwarzer <sschwarzer@…>
Remove test for `bytes` exception strings Assume that for Python 3, ftplib always gives us exception strings that are of type `str`.
6:30 PM Ticket #119 (Allow "pathlike" objects for paths) closed by schwa
fixed: I changed the title to let it reflect the ticket description. If …
6:24 PM Ticket #94 (asyncio) closed by schwa
wontfix: As mentioned in my comment, adding asyncio support to …
6:11 PM Ticket #105 (option to preserve mtime on upload and download) closed by schwa
wontfix: There hasn't been a reply for years and I don't know how to implement …
2:00 PM Ticket #118 (In-memory downloads) closed by schwa
duplicate: Closing this ticket as duplicate of #128, which has more discussion on …

Jan 1, 2020:

10:49 PM Ticket #130 (Consider making some arguments keyword-only) closed by schwa
fixed: I only made very few arguments keyword-only arguments and don't plan …
10:43 PM Changeset [1896:aaeeadd56119] by Stefan Schwarzer <sschwarzer@…>
Use consistent statement order Use consistent statement order in `if` and `else` branch.
10:35 PM Changeset [1895:3c3ac50e0334] by Stefan Schwarzer <sschwarzer@…>
Make `rest` a keyword-only argument This applies to `FTPHost.open` and `FTPFile._open`. The latter is only used internally. Making `rest` a keyword-only argument has several reasons: - Python's built-in `open` has two additional arguments that aren't supported in `FTPHost.open`, i. e. they're not in `FTPHost.open`'s argument list. Using `rest` as a positional argument may create confusion about the role of this positional argument. (The position 7 has completely different semantics in Python's `open` and `FTPHost.open`.) - Adding other `open` arguments modeled after Python's `open` will be easier. These arguments can now get the corresponding positions as in Python's `open`. - The `rest` argument probably is rarely used, especially as a positional argument, so very few people would be affected.
10:34 PM Changeset [1894:eb173e9673db] by Stefan Schwarzer <sschwarzer@…>
Make `encrypt_data_channel` and `debug_level` keyword-only args
10:29 PM Changeset [1893:2c759f11ddd2] by Stefan Schwarzer <sschwarzer@…>
Add comment on different API from `shutil`
10:24 PM Changeset [1892:d986c34ffffb] by Stefan Schwarzer <sschwarzer@…>
Remove obsolete comment
10:19 PM Changeset [1891:42ece407f2fe] by Stefan Schwarzer <sschwarzer@…>
Remove `FTPFile.next` method This was only needed for Python 2.x.
10:16 PM Changeset [1890:e067bc331d9e] by Stefan Schwarzer <sschwarzer@…>
Remove arguments from `super()` This is no longer necessary in Python 3.
10:13 PM Ticket #132 (Simplify `ftputil.error`) created by schwa
The FTPError class and some other code in the ftputil.error module …
9:57 PM Changeset [1889:15c2cc4fdb14] by Stefan Schwarzer <sschwarzer@…>
Revise documentation for ftputil 4.0.0 I did a lot of changes and don't want to commit or even mention them all individually. Nevertheless, here are some changes I made: - Remove references to Python 2.x - Remove references to M2Crypto. Most users will just use the `ftplib.FTP_TLS` class. See also ticket #78. - Update minimumm Python version (now 3.6) - (Mostly) avoid terms like "unicode strings" and "byte strings" because these are rarely used nowadays. Instead use "strings" and "bytes" or `str`/`bytes`. - Change http links to https (I didn't notice any instances where the target didn't support https) - Update links to the Python standard library where necessary - Some wording changes I may have forgotten some advisable changes. Maybe I'll make another revision before the release of ftputil 4.0.0(-beta).
8:15 PM Changeset [1887:31c01275f303] by Stefan Schwarzer <sschwarzer@…>
Document that `PathLike` objects are allowed Avoid "byte strings" and "unicode strings". Use `bytes` and `str` instead since this is the (more) common terminology with Python 3.
8:10 PM Changeset [1888:eb178ea1b589] by Stefan Schwarzer <sschwarzer@…>
Use "ticket" instead of "bug report" "Ticket" sounds a bit simpler. I think it's the more common term nowadays.
7:36 PM Changeset [1886:305c0878e989] by Stefan Schwarzer <sschwarzer@…>
Remove `split` and `join` from query methods `split` and `join` aren't methods that "get information about directories, files and links", so they don't belong in this list.
7:34 PM Changeset [1885:dd2d5ff8c810] by Stefan Schwarzer <sschwarzer@…>
Change next version to 4.0.0-beta
7:22 PM Changeset [1884:a3f58fa3920e] by Stefan Schwarzer <sschwarzer@…>
Test if `FTPHost.path` methods accept `PathLike` objects The tests are simplified by adding a `path_converter` class variable that either returns a bytes/str path directly (in `TestAcceptEitherBytesOrStr`) or wraps them in `Path` objects (in `TestAcceptEitherBytesOrStrFromPath`).
6:55 PM Changeset [1882:c6f5f6f0e027] by Stefan Schwarzer <sschwarzer@…>
Use `join` from `posixpath` The type checks in our custom `join` method were only needed to enforce type consistency for Python 2. This consistency check is already in Python 3's `posixpath.join` and it can also handle `PathLike` objects. Also remove the test code because we assume that Python's `join` implementation is already tested properly.
6:48 PM Changeset [1883:c8a0a54c39f1] by Stefan Schwarzer <sschwarzer@…>
Order `posixpath` attributes alphabetically Follow the order in the current Python documentation for `os.path` to make the list easier to compare with the Python module. Note that the methods we use from the `posixpath` module can only be methods that don't need local file system access. Obviously, we need to access files on the FTP server instead. :-)
6:26 PM Changeset [1881:0ea562acdc6c] by Stefan Schwarzer <sschwarzer@…>
Add term "3-clause" Add term "3-clause" to clarify what the "modified" BSD license is. Unfortunately, the names for this license aren't very telling, but more people may know "3-clause" by now.
6:25 PM Changeset [1880:7b014bcd92bb] by Stefan Schwarzer <sschwarzer@…>
Update year in license Seems I had forgotten this for a long time.
6:12 PM Changeset [1879:831dacddb87c] by Stefan Schwarzer <sschwarzer@…>
Support `PathLike` objects in `as_bytes` and `as_str`
6:11 PM Changeset [1878:33aa9270f45d] by Stefan Schwarzer <sschwarzer@…>
Document `TypeError` for invalid argument
5:34 PM Changeset [1877:a07e12d6fdfb] by Stefan Schwarzer <sschwarzer@…>
Change argument `content_source` to `path` The latter is clearer and in line with the upcoming changes of arguments that are currently used for strings, but will also allow `PathLike` values.
3:48 PM Changeset [1875:db8ce45a55ff] by Stefan Schwarzer <sschwarzer@…>
Add missing bracket in comment
3:46 PM Changeset [1874:050ea0503b44] by Stefan Schwarzer <sschwarzer@…>
Test that ticket 131 is fixed This requires `freezegun` as a development dependency.
3:38 PM Changeset [1873:551f3d4ddf29] by Stefan Schwarzer <sschwarzer@…>
Simplify parser test logic When creating a "dir line" in a `dir_line` call it's (at least for me) much more intuitive if the time in the resulting string is the local time (or a naive datetime) I pass to `dir_line`. However, the previous implementation implicitly applied `time.localtime`, which confused me a lot during debugging ticket 131. The changed implementation of `dir_line` takes a naive `datetime` object and just applies the format, without any timezone changes. To make everything fit together, change `_test_time_shift` to internally create the server time as a `datetime` object, not as a float in seconds.
1:23 AM Changeset [1876:f0f5c7f9993d] by Stefan Schwarzer <sschwarzer@…>
Support `PathLike` objects in `same_string_type_as` If a `PathLike` object is passed as `type_source` argument, the result from its `__fspath__` method is used to determine the actual `type_source`.
1:11 AM Ticket #131 (Unix time parser uses wrong year if server time is in the next year ...) closed by schwa
fixed
1:03 AM Changeset [1872:435b04a1c040] by Stefan Schwarzer <sschwarzer@…>
Fix bug around year change (ticket #131) The previous code failed around a year change when the local client time was still in one year and the local server time already in the next year. See the ticket for details.
12:15 AM Ticket #131 (Unix time parser uses wrong year if server time is in the next year ...) created by schwa
The method ftputil.stat.Parser.parse_unix_time is responsible for …

Dec 31, 2019:

8:34 PM Changeset [1871:f588265d2fd6] by Stefan Schwarzer <sschwarzer@…>
Remove obsolete comment
7:52 PM Changeset [1870:305bca956bcc] by Stefan Schwarzer <sschwarzer@…>
Rename test methods Use `str` instead of `unicode` for the type in test method names. `str` is the usual name for the unicode string type in Python 3.
7:50 PM Changeset [1869:3d600fbc0149] by Stefan Schwarzer <sschwarzer@…>
Add dummy target Avoid accidental patching if running `make` without target.
7:46 PM Changeset [1868:8e98efdccb04] by Stefan Schwarzer <sschwarzer@…>
Update `as_bytes` docstring
7:46 PM Changeset [1867:6b4bf291d1e3] by Stefan Schwarzer <sschwarzer@…>
Remove `encode_if_unicode` This function is no longer needed.
7:40 PM Changeset [1866:17a2935104e2] by Stefan Schwarzer <sschwarzer@…>
Remove `as_default_string` This function is now redundant because we only support Python 3, where the default string type (`str`) is a unicode string.
7:36 PM Changeset [1865:9b383c76caf7] by Stefan Schwarzer <sschwarzer@…>
Rename `tool.as_unicode` to `tool.as_str` We now only support Python 3 where the default string type is called `str`, not `unicode`. Hence using `str` may be clearer.
7:24 PM Changeset [1864:e489c7fb42d9] by Stefan Schwarzer <sschwarzer@…>
Add draft for announcement of version 4.0.0-beta This is a preliminary announcement that may differ from the actually sent announcement. Hopefully `pathlib` compatibility will be improved until the actual release.

Dec 30, 2019:

9:47 PM Changeset [1863:2b56c710153e] by Stefan Schwarzer <sschwarzer@…>
Add TODO items on `PathLike` API
8:10 PM Changeset [1862:4d78d97c21b7] by Stefan Schwarzer <sschwarzer@…>
Update `todo.txt` The deleted items are done.
8:03 PM Changeset [1861:79cb926b5e6f] by Stefan Schwarzer <sschwarzer@…>
Rename `TODO` to `todo.txt` The new name is easier to type, at least when using tab completion.
8:00 PM Ticket #130 (Consider making some arguments keyword-only) created by schwa
ftputil 4.0.0 will introduce backward-incompatible changes. One of …

Dec 29, 2019:

9:13 PM Ticket #129 (Make cache more effective (supersedes #108)) created by schwa
Make cache more effective by storing and using more information. As …
8:15 PM Changeset [1860:c8844d7dd082] by Stefan Schwarzer <sschwarzer@…>
Use local `cache` shortcut Use local `cache` shortcut which was defined at the start of the method.
8:03 PM Changeset [1859:e542560d38f9] by Stefan Schwarzer <sschwarzer@…>
Use `yield from` Since we no longer need to support Python 2, we can simplify the code by using `yield from`.
7:36 PM Changeset [1858:7c1c214458f6] by Stefan Schwarzer <sschwarzer@…>
Add `newline` argument to `StringIO` constructor The `StringIO` objects are used as the mock result of `socket.makefile` calls. However, the default for `newline` for `StringIO` is "\n", which differs from the default `None` for `open` and `socket.makefile`. Therefore, to let `StringIO` behave like the real-life `makefile` return value, we must pass a `newline` argument that matches the `newline` argument for `host.open` in each of the tests. If no `newline` argument for `FTPHost.open` is given, the default of `socket.makefile` is used implicitly, which is `newline=None`, so we must pass the same value to the `StringIO` constructor explicitly.
7:07 PM Changeset [1855:a577970005af] by Stefan Schwarzer <sschwarzer@…>
Pass original mode to `socket.makefile` For the previous Python 2 support, it was necessary to always create a socket file for binary mode. (There wasn't a text mode for files created with `socket.makefile`.) Since we no longer support Python 2, we can pass the mode directly to `socket.makefile` and don't need wrapping of the file object returned from `socket.makefile` in a `TextIOWrapper`. While adapting the tests, it turned out that the file object returned by `socket.makefile` works slightly different than the one returned from the previous `TextIOWrapper`. Specifically, `\r\n` sequences are not converted to `\n` when reading file data. I'm not exactly sure whether this is a side effect of running the tests only under Posix. Possibly the behavior is different on Windows. If the behavior differed depending on the platform, this would be a bit weird; I wouldn't expect this much less than differences in the processing of _local_ files (i. e. file system files). *** Update comment *** Remove obsolete comment

Dec 28, 2019:

10:10 PM Changeset [1857:4c4b99d0c627] by Stefan Schwarzer <sschwarzer@…>
Raise `TypeError` if `mode` is `None` This is Python's behavior for local files.
10:00 PM Changeset [1856:8d988c761774] by Stefan Schwarzer <sschwarzer@…>
Add test for "missing" `mode` argument This works because `FTPHost.open` sets `mode` to "r" by default. On the other hand, passing `None` for the mode to `FTPFile._open` causes a TypeError: argument of type 'NoneType' is not iterable However, this isn't so relevant since clients should always use `FTPHost.open`, not `FTPFile._open`.
9:09 PM Ticket #98 (Migrate current unit tests to use the `mock` and `py.test` packages) closed by schwa
fixed: Done as of [442b8ca8a85e].
9:07 PM Changeset [1854:19881b69f792] by Stefan Schwarzer <sschwarzer@…>
Remove obsolete comment This has been covered in the last commits.
9:02 PM Changeset [1853:9c738419f52c] by Stefan Schwarzer <sschwarzer@…>
Use (almost) same test data Use almost the same test data for text/binary read/write tests. In some cases, I can't use the test data literally, for example in the `readlines`/`writelines` tests.
8:14 PM Changeset [1852:c04924e27d3b] by Stefan Schwarzer <sschwarzer@…>
Add more TODO items
8:09 PM Changeset [1851:14b6386a4f89] by Stefan Schwarzer <sschwarzer@…>
Remove WebDAV support from TODO This isn't feasible to add to ftputil while I'm the only maintainer and want to work on more projects than ftputil.
7:55 PM Changeset [1850:c7affcde25cf] by Stefan Schwarzer <sschwarzer@…>
Revise tests for file reading and writing In the past, the concepts "ASCII" and "binary" in ftputil referred to the corresponding concepts for FTP. That is, "binary" meant transferring the data without changes and "ASCII" meant normalization of line endings to `\n`. This meaning of "ASCII" and "binary" is no longer used in ftputil (since a long time). Instead, we now use the concepts "text" and "binary" as they're understood in the Python context (i. e. as if opening files in text or binary mode with `open`). I also added a few umlauts in some tests to see if the encoding/decoding works. That said, I'm sure the tests could be improved: - Use the same test string in all text/binary read/write tests. - Test if "half umlauts" are split correctly in binary mode. For example, a German "ä" is encoded as b"\xc3\xa4", hence reading the first byte should give b"\xc3" and reading the second byte should give b"\xa4". On the other hand, if reading one _character_ from a text file, we'd read the whole single character.
7:30 PM Changeset [1849:677583e6e3c6] by Stefan Schwarzer <sschwarzer@…>
Use more "challenging" binary data This has `\r\n` and `\n` occurences.
6:51 PM Changeset [1848:7cca1ad2711f] by Stefan Schwarzer <sschwarzer@…>
Format source code with Black Format code in `ftputil` and `test` with Black. Don't format files in the `private` or other directories (or least not yet).
6:43 PM Changeset [1847:b106e2ecdec8] by Stefan Schwarzer <sschwarzer@…>
Print short tracebacks PyPy's default traceback occupy too much space.
6:42 PM Changeset [1846:8778221240b4] by Stefan Schwarzer <sschwarzer@…>
Document return type
Note: See TracTimeline for information about the timeline view.