Python Forum
Error messages when installing Python 3.7
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error messages when installing Python 3.7
#1
When installing Python 3.7 on Raspbian, during the make phase I get several messages related to string functions, similar to this one:

/home/pi/Python-3.7.0/Modules/readline.c: In function ‘call_readline’:
/home/pi/Python-3.7.0/Modules/readline.c:1303:9: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
strncpy(p, q, n);
^~~~~~~~~~~~~~~~
/home/pi/Python-3.7.0/Modules/readline.c:1279:9: note: length computed here
n = strlen(p);
^~~~~~~~~

What does this mean? Is this a known issue? Can I safely ignore this?

Pierre
Reply
#2
strncpy is a C copy routine that terminates either on a 0 byte (nul In C) of when n characters have been copied.
the error doesn't actually seem to be an error to me, only an indicator that 'n characters' were copied before finding a natural nul (0)
character. The error is in the 'C' function readline.c

I'm not familiar with Raspbian, but you should be able to install using:
sudo apt-get install python3
see: https://installvirtual.com/install-pytho...pberry-pi/
Reply
#3
I think the length of the string was determined with the strlen() function and then that value was used in the strncpy() function, but no trailing NUL was found in the string. O well, it works, I was just wondering why I got all those verbose and disturbing messages. It sometimes make me long for the days when all that computers said was "Ok" or "Err 0xFD" :-)
Reply
#4
Quote:It sometimes make me long for the days when all that computers said was "Ok" or "Err 0xFD"
don't wish that upon yourself, it could actually re-emerge.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020