title: Python date calculating with year and week of year is incorrect
body: <p>We are having an issue when calculating the start of the first week in 2019.</p>
  
  <p>The parameters are <code>year</code> and <code>week_of_year</code>. We are always staring the week at Monday.</p>
  
  <p>The code to get the first day of a specific year:</p>
  
  <pre><code>from datetime import datetime
  
  result = datetime.strptime('%04d-%02d-1' % (year, week_of_year), '%Y-%W-%w').date()
  </code></pre>
  
  <p>This works for most of the years, but not in the case when <code>year = 2019</code> and <code>week_of_year = 1</code>, Python computes this to the date <code>2019-01-02</code> and not the expected <code>2018-12-31</code>.</p>
  
  <p>Our current solution to solve this problem is:</p>
  
  <pre><code>from datetime import datetime, timedelta
  
  result = datetime.strptime('%04d-%02d-1' % (year, week_of_year), '%Y-%W-%w').date()
  
  # Fixes issue with Python date computing returning the incorrect date
  # This only occures for some years. E.g. 2019.
  offset = result.isocalendar()[1] - datetime.strptime('%04d-01-01' % year, '%Y-%m-%d').date().isocalendar()[1]
  if offset &gt; 0:
      result = result - timedelta(days=7)
  </code></pre>
  
  <p>Any other ideas on how to fix this issue?</p>