Custom Query (115 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (1 - 3 of 115)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#132 fixed Simplify `ftputil.error` schwa schwa
Description

The FTPError class and some other code in the ftputil.error module use a keyword argument original_exception. Since ftputil now targets only Python 3.6+ and Python 3 has exception chaining, we don't need a custom mechanism to refer to previous exceptions.

#131 fixed Unix time parser uses wrong year if server time is in the next year relative to client time schwa schwa
Description

The method ftputil.stat.Parser.parse_unix_time is responsible for parsing unix timestamps in directory lines. The code contains the following heuristics to guess the correct year on the server side:

# Try the current year
year = time.localtime()[0]
st_mtime = self._mktime((year, month, day, hour, minute, 0, 0, 0, -1))

The problem with this code is that it implicitly assumes that the year on the client side is the same as the year on the server side. This assumption is wrong if the years actually differ. For example, if the directory line on the server is

-rw-r--r--   1   45854   200   4604   Jan 01 01:49   index.html

but the local time on the client side is 2019-12-31T23:49, the code assumes that the January in the directory line refers to the previous January 1st from the point of view of the client. Consequently, the st_mtime of the stat result is about one year in the past for a file that was just created.

#130 fixed Consider making some arguments keyword-only schwa schwa
Description

ftputil 4.0.0 will introduce backward-incompatible changes. One of these changes is dropping support for Python 2.

Since we're breaking backward compatibility anyway and no longer need to support Python 2, this is a good time to check which arguments should become keyword-only arguments.

1 2 3 4 5 6 7 8 9 10 11
Note: See TracQuery for help on using queries.