Added
- new parameters
new_x
andnew_y
forcell()
andmulti_cell()
, replacingln=0
, thanks to @gmischler - new
add_highlight()
method to insert highlight annotations: documentation - new
offset_rendering()
method: documentation - new
.text_mode
property: documentation - the page structure of the documentation has been revised, with a new page about adding text, thanks to @gmischler
- a warning is now raised if a context manager is used inside an
unbreakable()
section, which is not supported
Changed
local_context()
can now "scope" even more properties, likeblend_mode
: documentation
Fixed
- No font properties should be leaked anymore after using markdown or in any other situations (cf. #359), thanks to @gmischler
- If
multi_cell(align="J")
is given text with multiple paragraphs (text followed by an empty line) at once, it now renders the last line of each paragraph left-aligned,
instead of just the very last line (cf. #364), thanks to @gmischler - a regression: now again
multi_cell()
always renders a cell, even iftxt
is an empty string - cf. #349 - a bug with string width calculation when Markdown is enabled - cf. #351
- a few bugs when parsing some SVG files - cf. #356, #358 & #376
- a bug when using
multi_cell(..., split_only=True)
inside anunbreakable
section - cf. #359
Deprecated
- The parameter
ln
tocell()
andmulti_cell()
is now deprecated, usenew_x
andnew_y
instead. - The parameter
center
tocell()
is now deprecated, usealign="C"
instead.
Displaying deprecation warnings
DeprecationWarning
s are not displayed by Python by default.
Hence, every time you use a newer version of fpdf2
, we strongly encourage you to execute your scripts
with the -Wd
option (cf. documentation)
in order to get warned about deprecated features used in your code.
This can also be enabled programmatically with warnings.simplefilter('default', DeprecationWarning)
.
I met a very strange Python module loading behaviour in Pelican today :
https://github.com/getpelican/pelican/blob/3395e71/pelican/settings.py#L21
Here is some minimal code reproducing the issue. It requires 5 files :
bug_repro.py
dir_a/__init__.py
dir_a/test_data/pelicanconf.py
dir_b/__init__.py
dir_b/test_data/pelicanconf.py
bug_repro.py
contains:
import dir_a
import dir_b
dir_a/__init__.py
and dir_b/__init__.py
both contain this code:
import os
from importlib.machinery import SourceFileLoader
print(SourceFileLoader('pelicanconf', os.path.dirname(__file__) + '/test_data/pelicanconf.py').load_module().THEME)
dir_a/test_data/pelicanconf.py
contains only the line THEME = 'localized_theme'
and dir_b/test_data/pelicanconf.py
is empty.
What will produces python3.7 bug_repro.py
? 😉
We had an issue with a SpringBoot web app where we had the following error message when querying /manage/beans
Could not write JSON Attempted to serialize java.lang.Class Forgot to register a type adapter?
This was due to org.springframework.boot.actuate.beans.BeansEndpoint.BeanDescriptor having a java.lang.Class<?>
attribute.
We fixed it by configuring our Gson bean this way :
@Bean
public static Gson gson() {
return new GsonBuilder()
...
.addSerializationExclusionStrategy(new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes field) {
return field.getDeclaredType().getTypeName().equals("java.lang.Class<?>");
}
@Override
public boolean shouldSkipClass(Class<?> clazz) {
return false;
}
})
.create();
}
Just a reminder to myself, for the next time I need to compile a classic GNU tool :
git clone --recurse-submodules https://git.savannah.gnu.org/git/grep.git
./bootstrap # no need to install gnulib or call autoreconf -vif & cie
./configure && make
I was checking if a bug still existed in latest source code of grep
.
It does not in v3.1.43, but the following hangs forever with grep
2.16 under Ubuntu:
env -i LANG=en_US.UTF-8 src/grep -Fq $'\377\302' ../ludochaordic/content/images/2015/05/Strip-SVN-800-final.jpg
It did not git bisect
to find out when the bug was solved.
Today I've been struggling to understand why this does not work in Firefox, but is OK in Chrome:
<html>
<head>
<meta charset="UTF-8">
<base href="/">
head>
<body>
<svg>
<symbol id="pretty-circle">
<circle cx="15" cy="15" r="10"/>
symbol>
<use xlink:href="#pretty-circle">use>
svg>
body>
html>
Here …
Due to a long standing bug, no history file will be kept of the commands you enter in an interactive shell when using a Python 3 virtualenv.
I found out a simple workaround. Simply put the following in your ~/.pythonrc
:
import atexit, os, readline, sys
if sys.version_info >= (3, 0 …